Followed Astro instructions to build Astro app But the app can not find the assets
Steps to produce:
npx astro add node
npm run build
node ./dist/server/entry.mjs
as documentation saidIt gives this error like below and doesn't apply css.
I recommend you try with the latest version or provide the version you tested with. I tried the same steps as you did, using
npx astro create
npx astro add node
which used version v1.6.15
I did got a build error Setting the 'mode' option is required
so I updated the astro.config.js
to look as follows :
import { defineConfig } from 'astro/config';
// https://astro.build/config
import node from "@astrojs/node";
// https://astro.build/config
export default defineConfig({
output: "server",
adapter: node({
mode: 'standalone'
})
});
after that build and run went smooth
npm run build
node ./dist/server/entry.mjs