Skip to content

Svelte 5 + <svelte:head> hydration error #11519

@amit13k

Description

@amit13k

Astro Info

Astro                    v4.12.2
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/svelte

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

After the Astro + Svelte 5 snippet issue was fixed recently (#11149), I tried using mode-watcher in an astro project. I am getting this hydration error, TypeError: Cannot read properties of null (reading 'nodeType'). It seems to be related to the use of <svelte:head>.

MRE using mode-watcher

MRE using svelte component with just <svelte:head>

Some discussion here, sveltejs/svelte#12409 (comment).

Is this a bug(svelte or astro?) or just a limitation when using svelte5 with astro ?

What's the expected result?

No hydration errors

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-auhvgj-unik9c?file=src%2Fpages%2Findex.astro,package.json,src%2Fpages%2F_a.svelte

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triagedpkg: svelteRelated to Svelte (scope)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions