Open enda opened 1 year ago
UPDATE:
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 : https://github.com/sveltejs/svelte/issues/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 around template, it seems to be ok.
I believe {#await} is losing its 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} : https://github.com/sveltejs/svelte/issues/6463
Reproduction
Create an app
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