You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astro v4.0.4
Node v20.9.0
System macOS (arm64)
Package Manager npm
Output server
Adapter @astrojs/vercel/serverless
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Generated URLs for scripts in astro files are incorrect when using SSR and rollup output options - customizing output file names. I have checked node and vercel adapters and this issue occurs for both of them, it works in SSG though.
You can check that the generated script src here is using relative path instead of an absolute one. I've added moment package just to make the script bigger, so it goes to a separate file (smaller ones are inlined in html) - it could by anything in the script. Additionally when you configure assetsPrefix in astro options it is not added to the script path as well.
My current workaround is to make an empty Preact component and put the scripts in that file, so it's loaded as an island - islands script paths are working correctly.
What's the expected result?
The src of the script is generated properly using absolute path. When assetsPrefix is specified in the astro options it should be taken into account.
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Generated URLs for scripts in astro files are incorrect when using SSR and rollup output options - customizing output file names. I have checked node and vercel adapters and this issue occurs for both of them, it works in SSG though.
You can check that the generated script src here is using relative path instead of an absolute one. I've added moment package just to make the script bigger, so it goes to a separate file (smaller ones are inlined in html) - it could by anything in the script. Additionally when you configure assetsPrefix in astro options it is not added to the script path as well.
My current workaround is to make an empty Preact component and put the scripts in that file, so it's loaded as an island - islands script paths are working correctly.
What's the expected result?
The src of the script is generated properly using absolute path. When assetsPrefix is specified in the astro options it should be taken into account.
Link to Minimal Reproducible Example
https://github.com/dkobierski/astro-script-issue
Participation
The text was updated successfully, but these errors were encountered: