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: Styles not rendered, gone from the DOM due to 3rd party framework interference (svelte/sveltekit) #6637
So in my (large and complex sveltekit) application i witnessed svelte doing heavy changes within <head>, in particular removing (previously) injected nodes
The problem is that - when svelte removes nodes that it added, it doesn't verify if the nodes actually belong to svelte components, their imported modules etc, it just removes everything between 2 nodes. Including <style> nodes of our component. So stencil owned styles - are removed. They are not added back after the fact.
On component insertion, style presence should be checked in real DOM (not only in an internal list), to avoid anything external meddling with the DOM nodes.
It would be handy to configure where styles should be injected, but i don't imagine any reasonable way of doing so.
System Info
irrelevant
Steps to Reproduce
I'll prepare a demo in some time and link it here.
On my end i gonna verify if setting scoped styles fixes my case (shadow dom should help, but i cant use it), and if not - will propose a fix.
I am taking this one. I will look into making the runtime re-check whether the style element still exists in the DOM before treating it as already registered, and I will add regression coverage if the repo test setup allows it.
Activity
saudademjj commentedon Mar 19, 2026
I am taking this one. I will look into making the runtime re-check whether the style element still exists in the DOM before treating it as already registered, and I will add regression coverage if the repo test setup allows it.