-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Astro Info
Astro v5.8.0
Node v22.12.0
System Linux (x64)
Package Manager npm
Output static
Adapter @astrojs/cloudflare
Integrations @astrojs/sitemap
@playform/compress
astro-broken-links-checker
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
As that can be seen in the title, this is a very specific issue: Scripts are not processed when they are in multiple slots where at least one slot uses Fragment and the other slot(s) are not included.
See the reproduction in StackBlitz. The script (in Test2) is not processed when it is in included in multiple slots where one uses Fragment and the other slot is not included in the final output of the page. If you open the example you can see that Test2 is not executed as otherwise the "script is working!" would be shown on the page. If you change the Fragment slot="prod" to div slot="prod", the issue disappears. It seems like this issue only appears if at least one of slots is using Fragment. This also applies if both slots are using fragment and no default slot is used.
What's the expected result?
The script should be bundled when it is included in the page, so in the example, "hello" should be shown in the console.
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.