You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Stencil Hydrate | value.split is not a function when using <svg> #4278
index-1d3c5472.js:3001 TypeError: value.split is not a function
at parseClassList (index-1d3c5472.js:1780:56)
at setAccessor (index-1d3c5472.js:1640:32)
at updateElement (index-1d3c5472.js:1794:17)
at patch (index-1d3c5472.js:2193:17)
at updateChildren (index-1d3c5472.js:2002:13)
at patch (index-1d3c5472.js:2199:13)
at updateChildren (index-1d3c5472.js:2002:13)
at patch (index-1d3c5472.js:2199:13)
at updateChildren (index-1d3c5472.js:2002:13)
The problem seems that element.className returns an SvgAnimatedString for svg-Elements instead of an expected string.
In the updateElement method we see that oldVNodeAttrs holds the SvgAnimatedString instead of a normal string.
Expected Behavior
Updating the class in Stencil Hydrate on svg Elements should work.
System Info
Stencil 2.23.2, don't know if v3 is also affected.
Steps to Reproduce
Add an <svg> element to a component. Use Stencil Hydrate and render the components server-side. Error occurs on client side hydration.
changed the title [-]bug: Stencil Hydrate must not use className property with svg[/-][+]bug: Stencil Hydrate | value.split is not a function when using <svg>[/+]on Apr 18, 2023
Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.
Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
Yeah this is definitely something I would like to fix, however I just tried
my hand at reproducing it and wasn’t able to (using Stencil 4.0.4). Would
you be able to put together a reproduction case? You can start with the
output of `npm init stencil` and then make the modifications you need to
reproduce the issue. If you then put it on GitHub as a separate repro we
can use it to diagnose the problem and fix the bug.
Without a reliable way to reproduce bugs it’s hard for us to know what to
fix!
FYI, I've removed the assignments/'bug: validated' labels from this issue. To echo @alicewriteswrongs@mayerraphael if you could create a minimal repro case for us, we'd greatly appreciate it!
Cant reproduce the error in an isolated example (Stencil 2.22.3/v3/v4 and NextJS 13.3). Will have to look on my part what may cause this. Weird, as i'm not the only one having this problem.
With today's release of Stencil v4.1.0, we introduced a new flag called experimentalSlotFixes. Currently, the flag enables Stencil's pre-existing slot-related fix configuration flags. Going forward, the Stencil team is going to be working with the original author of #2938 to incrementally add the fixes in #2938 into Stencil under experimentalSlotFixes in subsequent releases.
I've labeled this to get ingested into our backlog for us to write a test against this bug. This ought to help ensure that as we work to integrate the work from #2938 into the codebase, we don't introduce any SVG-related regressions. Thanks for your work in tracking this down for us!
Hey @mayerraphael, I just added a regression test for this issue in #4783. This should ensure that as we're fixing various slot-behavior-related issues in Stencil's runtime code we can't accidentally introduce the bug documented here into main. Since we now have that assurance I'm going to close this issue.
Activity
[-]bug: Stencil Hydrate must not use className property with svg[/-][+]bug: Stencil Hydrate | value.split is not a function when using <svg>[/+]alicewriteswrongs commentedon Apr 19, 2023
Hey @mayerraphael thanks for filing this issue!
If you have time, would you mind adding a reproduction case? It really helps us to diagnose and fix bugs.
ionitron-bot commentedon Apr 19, 2023
Thanks for the issue! This issue has been labeled as
needs reproduction. This label is added to issues that need a code reproduction.Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.
If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.
For a guide on how to create a good reproduction, see our Contributing Guide.
mayerraphael commentedon Apr 20, 2023
@alicewriteswrongs I hope i find time till tomorrow. Thanks for taking your time looking into the issue.
mayerraphael commentedon Aug 11, 2023
@alicewriteswrongs This bug seems to be related to #2938 . Other people are reporting this error there too.
alicewriteswrongs commentedon Aug 11, 2023
rwaskiewicz commentedon Aug 14, 2023
👋
FYI, I've removed the assignments/'bug: validated' labels from this issue. To echo @alicewriteswrongs @mayerraphael if you could create a minimal repro case for us, we'd greatly appreciate it!
mayerraphael commentedon Aug 18, 2023
Cant reproduce the error in an isolated example (Stencil 2.22.3/v3/v4 and NextJS 13.3). Will have to look on my part what may cause this. Weird, as i'm not the only one having this problem.
mayerraphael commentedon Aug 21, 2023
@rwaskiewicz @alicewriteswrongs I could reproduce it, finally!
This error seems to be related to #2938 because i only get the error message on
@stencil/[email protected]or the johnjenkins community version.Here the reproduction repository: https://github.com/mayerraphael/stencil-bug-playground
Edit: I guess v3/v4 work correctly. SSR classes are not removed.
rwaskiewicz commentedon Aug 21, 2023
Thanks @mayerraphael!
With today's release of Stencil v4.1.0, we introduced a new flag called
experimentalSlotFixes. Currently, the flag enables Stencil's pre-existing slot-related fix configuration flags. Going forward, the Stencil team is going to be working with the original author of #2938 to incrementally add the fixes in #2938 into Stencil underexperimentalSlotFixesin subsequent releases.I've labeled this to get ingested into our backlog for us to write a test against this bug. This ought to help ensure that as we work to integrate the work from #2938 into the codebase, we don't introduce any SVG-related regressions. Thanks for your work in tracking this down for us!
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children
test(hydrate): add a regression test for hydrating SVG children (#4783)
alicewriteswrongs commentedon Sep 14, 2023
Hey @mayerraphael, I just added a regression test for this issue in #4783. This should ensure that as we're fixing various slot-behavior-related issues in Stencil's runtime code we can't accidentally introduce the bug documented here into
main. Since we now have that assurance I'm going to close this issue.