question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nuxi build Could not load server.mjs

See original GitHub issue

Environment


  • 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:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
ilijanoviccommented, Jun 14, 2022

I found an temporary solution.

If you take a look at /.nuxt/dist/server/ then you will see that there is no server.mjs. After creating an empty server.mjs it works just fine.

I also using ssr: false

2reactions
isamuninjacommented, Oct 28, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found