withastro / astro

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

Server island not work when using preload library #12421

Open futamiy opened 2 days ago

futamiy commented 2 days ago

Astro Info

Astro                    v4.16.10
Node                     v22.11.0
System                   Windows (x64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind
                         @astrojs/svelte

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

No response

Describe the Bug

When in page with server island and open link with server island (and same name component too) where using preload library like framethrower, component not loaded and show this error CopyQ eBdChL CopyQ bObKnR

Repo

What's the expected result?

server island component load normally even use preload library

Link to Minimal Reproducible Example

Web Preview: https://4885e27d.futami.pages.dev/ Stackblitz Link: https://stackblitz.com/edit/withastro-astro-tkdvnm?file=package.json

Participation

apatel369 commented 2 days ago

@futamiy Please provide a valid reproduction. Here is the guide to create it.

github-actions[bot] commented 2 days ago

Hello @futamiy. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

futamiy commented 2 days ago

stackblitz link: https://stackblitz.com/edit/withastro-astro-tkdvnm?file=package.json

ematipico commented 1 day ago

What does flamethrower do? Without the library, the server island works, so @futamiy you would need to explain to us at least what's happening.

futamiy commented 1 day ago

Video reproduce

https://github.com/user-attachments/assets/0700827a-e197-4bac-b9af-f98c73515609

Error code CopyQ HGUnfH

When click a link and using flamethrower, image can't show until refreshed manually because replacing body from library Explain framethrower video: https://youtu.be/SJeBRW1QQMA?t=311

ematipico commented 1 day ago

I don't think there's much we can do, if a library messes up with script tags, we can't prevent it.

I will send a PR to avoid that runtime error in the console, but maybe you should check if that library allows to prevent prefetching all script tags