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
In dev mode everything is resolved fine, but when building for prod the files are getting splitted up in client and server.
The client bundle contains css and js files while the server folder only contains the entry.mjs file.
Now when generating the html it produces import paths like this: http://localhost:8085/assets/asset.de15421c.css. This path is correct when served from the right folder. But thats not the case. This way the browser cannot load styles or js files. Hopefully somebody is able to help me.
Steps to reproduce.
Clone repo
NPM install
Start dev server and see how the styles of the button and the functionality works
Deno:
run npm build
run deno run index.js --allow-net and go to localhost:8085
Node
add "type": module", to package.json
run npm run build
uncomment node code in index.js
run node index.js and go to localhost:3000
Result
The button is not blue and when clicking on it, there is no alert.
The Node adapter isn't intended to be a fully web server. It's only meant to be used as middleware for you to use in your own web server where you handle things like static file serving yourself. With something like Express this is very easy.
Deno, I guess, should serve static files as well, given that you can deploy straight to Deno Deploy without any extra code of your own.
Ahhh thank you very much for pointing this out and adding it to the Deno Adapter. Of course I know how to add it to express but I thought it would be inside the scope of the Middleware.
What version of
astro
are you using?1.0.0-beta.8
Are you using an SSR adapter? If so, which one?
Deno, Node
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the Bug
In dev mode everything is resolved fine, but when building for prod the files are getting splitted up in client and server.
The client bundle contains css and js files while the server folder only contains the entry.mjs file.
Now when generating the html it produces import paths like this:
http://localhost:8085/assets/asset.de15421c.css
. This path is correct when served from the right folder. But thats not the case. This way the browser cannot load styles or js files. Hopefully somebody is able to help me.Steps to reproduce.
Deno:
run npm build
run
deno run index.js --allow-net
and go to localhost:8085Node
add
"type": module",
topackage.json
run
npm run build
uncomment node code in
index.js
run
node index.js
and go to localhost:3000Result
The button is not blue and when clicking on it, there is no alert.
Link to Minimal Reproducible Example
https://github.com/muellercornelius/Astro-SSR-asset-resolving-bug
Participation
The text was updated successfully, but these errors were encountered: