withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
47.25k stars 2.51k forks source link

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

Open AdrianButler opened 3 months ago

AdrianButler commented 3 months ago

Astro Info

Astro                    v4.14.5
Node                     v22.6.0
System                   Windows (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/sitemap
                         @astrojs/tailwind
                         @astrojs/svelte
                         @playform/compress
                         astro-compressor

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

No response

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.

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)

What's the expected result?

The component loads correctly with no errors

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-1mfzqq?file=astro.config.mjs

Participation

NikolaRHristov commented 1 month ago

@AdrianButler https://github.com/PlayForm/Compress/releases/tag/Compress%2Fv0.1.2