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
When using an {#await} in svelte:head, the head elements starts to be broken: the awaited elements are never destroy on route change.
But, if I await a component in svelte:head, which itself has a svelte:head around template, it seems to be ok.
I believe {#await} is losing its svelte:head scope, and using a component with a svelte:head is a possible work around to redefine the scope, but it's not very elegant in some cases.
Possible similar issue fixed last year about duplicate element in head with {@html} : #6463
Reproduction
Create an app
npm create svelte@latest my-app
cd my-app
npm install
npm run dev -- --open
The possible work around with a new components wrapping elements in its <svelte:head> is not rendered by SSR. Without <svelte:head> in children component, it is. Inception of <svelte:head> is finally not a good idea.
It become a blocking issue for me
It's also very useful for exemple to add a <link rel="preload"> for images above the fold from a Card component from <body>.
UPDATE2:
Without <svelte:head> in component, the component is not removed from <head> after route change.
Opened a second issue here : #9332
Describe the bug
When using an {#await} in svelte:head, the head elements starts to be broken: the awaited elements are never destroy on route change.
But, if I await a component in svelte:head, which itself has a svelte:head around template, it seems to be ok.
I believe {#await} is losing its svelte:head scope, and using a component with a svelte:head is a possible work around to redefine the scope, but it's not very elegant in some cases.
Possible similar issue fixed last year about duplicate element in head with {@html} : #6463
Reproduction
Create an app
npm create svelte@latest my-app cd my-app npm install npm run dev -- --open
Add this code just before </svelte:head>
Open browser and console, change route and come back to home, you have two
<link rel="hello" as="world />
Move
<link rel="hello" as="world" />
in a component like that to make it works:Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: