Skip to content

TypeError: Cannot read properties of null (reading 'nodeType') (Astro + Svelte 5)Β #13088

@AdrianButler

Description

@AdrianButler

Describe the bug

I am getting this error and my svelte component will not load at all. It works perfectly fine in dev environment but when I build or run preview it stops working and the error is thrown in the console.

Reproduction

https://gist.github.com/AdrianButler/4b04009c797bf37599c6763d09111a0b

This component is being used in a astro file with the client directive of load

This only happens in production build and the component works perfectly fine in dev environment

Logs

faq/:1 [astro-island] Error hydrating /_astro/FaqQuestion.B9nkJrIu.js TypeError: Cannot read properties of null (reading 'nodeType')
    at Ut (template.BZob6Wd_.js:1:8993)
    at G (FaqQuestion.B9nkJrIu.js:1:1234)
    at render.Eek01tEQ.js:1:1270
    at Sn (template.BZob6Wd_.js:1:5360)
    at U (template.BZob6Wd_.js:1:6097)
    at k (template.BZob6Wd_.js:1:2186)
    at bt (template.BZob6Wd_.js:1:2805)
    at render.Eek01tEQ.js:1:1212
    at Sn (template.BZob6Wd_.js:1:5360)
    at U (template.BZob6Wd_.js:1:6097)

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700K
    Memory: 17.34 GB / 31.77 GB
  Binaries:
    Node: 22.6.0 - ~\AppData\Roaming\JetBrains\WebStorm2024.2\node\versions\22.6.0\node.EXE
    npm: 10.8.2 - ~\AppData\Roaming\JetBrains\WebStorm2024.2\node\versions\22.6.0\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting submitterneeds a reproduction, or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions