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 a parent component has a <svelte:head> tag and a nested component inside it with a also a <svelte:head>, the content of the head tag of the nested component is stripped out in SSR.
Example:
Parent component
<script>
import ChildNested from './ChildNested.svelte'
</script><svelte:head>_PREFIX_<ChildNested/>_SUFFIX_</svelte:head>
Try with separating the rendering of the parent component's head and body in different statements, so that the head content of the nested component is not stripped out in SSR. Alternatively, you could modify the create_ssr_component function to return both the head and body, ensuring that the head content is included in the SSR output.
Describe the problem
When a parent component has a
<svelte:head>
tag and a nested component inside it with a also a<svelte:head>
, the content of the head tag of the nested component is stripped out in SSR.Example:
Parent component
Child component
Simple reproduction REPL, you can see the generated code for SSR at JS output tab.
Pseudo equivalent generated code to understand the problem within the browser console:
Related issues / discussions.
Describe the proposed solution
At
$$render
if parent is asvelte:head
return head content as body.Alternatives considered
Maybe changing what
create_ssr_component
returns (return both head and body) or separate head and body rendering in different statements.Importance
nice to have
The text was updated successfully, but these errors were encountered: