Asset files do not load when using custom file names + node adapter #426
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
pkg: node
Related to Node adapter (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When using custom file names in vite rollup options (as documented here) with the node adapter, some assets are moved to the server folder resulting in 404 errors on the client.
Reproduction: https://github.com/utkarshkukreti/astro-asset-file-names-bug/ (I could not get the node adapter working on stackblitz so I uploaded the repo instead.)
Build and run with:
pnpm build && node dist/server/entry.mjs
, open http://localhost:4321/ and you'll see the css does not load.Diff from the astro starter template: https://github.com/utkarshkukreti/astro-asset-file-names-bug/compare/8f07d763094819d96096ceae6c601eca25cecbc8..main
Built files:
$ find dist | grep css dist/server/assets/asset.DUCGYX_l.css
The browser requests
/assets/asset.DUCGYX_l.css
which returns a 404 error.What's the expected result?
The css files should load. (They should probably be in the client/ folder not server/)
Link to Minimal Reproducible Example
https://github.com/utkarshkukreti/astro-asset-file-names-bug
Participation
The text was updated successfully, but these errors were encountered: