svelte
svelte copied to clipboard
[fix] check for parent_component before accessing root
Fixes #6584.
Tests
No tests
Hello any update on this ? It would fix many problems. Thanks
Does defining document
as fallback really work as expected? To me it seems a bit suspicious.
Hello, I have the same issue on my side with the latest version.
In fact, if we check the parent_component
value it's works.
But if we set the value as a document
we need to refactor the append_styles
function behind which is return undefined (and crash) if the root are document
Actually, in my case the reason of the problem was that svelte was included in a component library project. This led to various bugs, being one of them this undefined parent_component
. I wonder, that possibly different/multiple svelte versions in the application and the used svelte component (npm package) might be the real reason of such issues.
Thanks for the PR, but this isn't a real fix for the underlying problem, which is that people are using different compiled versions of Svelte mixed up in the same project. This fix might solve the undefined issue, but other subtle bugs due to different compiler versions may occur. More info here: https://github.com/sveltejs/svelte/issues/6584#issuecomment-1019578529