nuxi build Could not load server.mjs
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v14.18.0
- Nuxt Version:
3.0.0-27257216.f5aea9f
- Package Manager:
npm
- Bundler:
Vite
- User Config:
css
,build
,srcDir
,ssr
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
When I run the command nuxi build
or npm run build
I get the error message:
ERROR Rollup error: Could not load …/.nuxt/dist/server/server.mjs (imported by node_modules/@nuxt/nitro/dist/runtime/app/render.mjs): ENOENT: no such file or directory, open ‘/…/.nuxt/dist/server/server.mjs’
Reproduction
When I run the command nuxi build
or npm run build
I get the error message:
ERROR Rollup error: Could not load …/.nuxt/dist/server/server.mjs (imported by node_modules/@nuxt/nitro/dist/runtime/app/render.mjs): ENOENT: no such file or directory, open ‘/…/.nuxt/dist/server/server.mjs’
Additional context
I have tried this on both my local development environment and a remote AWS Amplify instance. Both environments present the same error.
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Runtime Config · Nuxt Advanced
Runtime Config. Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it...
Read more >Cannot find module 'pinia/dist/pinia.mjs' when using run dev
As mentioned here, there is an issue with NPM not doing it's job properly, here is how you can solve it: npm i...
Read more >Deploying a new nuxt 3 app result to error - Support
Hello, I've created a new nuxt 3 app and tried to delopy it to netlify with github: stoic-fermat-995d10 The build stop when It...
Read more >Nuxt configuration file
export default { build: { /* ** You can extend webpack config here ... should hold all env variables that are private and...
Read more >Using Modules and Pinia to structure Nuxt 3 app
Building a Hello World application in Nuxt 3 is relatively simple, but you will most ... For that you could utilize the concept...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found an temporary solution.
If you take a look at
/.nuxt/dist/server/
then you will see that there is noserver.mjs
. After creating an emptyserver.mjs
it works just fine.I also using
ssr: false
@danielroe that happens when the ssr option is false
https://codesandbox.io/s/boring-paper-5qr99?file=/nuxt.config.ts