Error: Cannot find module "server.mjs"
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.19.1
- Nuxt Version:
2.16.0-27358576.777a4b7f
- Package Manager:
npm@8.6.0
- Builder:
webpack
- User Config:
rootDir
,bridge
,telemetry
,nitro
,head
,css
,plugins
,components
,buildModules
,modules
,compilerOptions
,build
,watchers
,ssr
- Runtime Modules:
-
- Build Modules:
@nuxt/bridge@3.0.0-27495135.4d1a6ba
Reproduction
- Clone https://github.com/HendrikJan/nuxt-bridge-error-demo
- Run
npm install
- Run
npx nuxi dev
- Go to
http://localhost:3000/
- See the error in your terminal and in your browser
Describe the bug
Since a recent update I cannot get Nuxt to work anymore. The application builds without errors, but when loading the page I get the 500 status with the error.
The error in the terminal is this:
✔ Builder initialized 09:18:46
✔ Nuxt files generated 09:18:46
✔ Client
Compiled successfully in 3.12s
✔ Nitro built in 269 ms nitro 09:18:50
ℹ Waiting for file changes 09:18:50
[nitro] [request error] Cannot find module '/home/haaiee/Projects/Docker/nuxt-bridge-error-demo/.nuxt/dist/server/server.mjs' imported from /home/haaiee/Projects/Docker/nuxt-bridge-error-demo/.nuxt/dev/index.mjs
at new NodeError (internal/errors.js:322:7)
at finalizeResolution (internal/modules/esm/resolve.js:318:11)
at moduleResolve (internal/modules/esm/resolve.js:776:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)
at Loader.resolve (internal/modules/esm/loader.js:89:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
at Loader.import (internal/modules/esm/loader.js:177:28)
at importModuleDynamically (internal/modules/esm/translators.js:114:35)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at ./.nuxt/dev/index.mjs:371:66
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
This answer was the one that helped me! I was using import and the file was .js - Adding --es-module-specifier-resolution=node saved the day...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
Why the "Error: cannot find module" Occurs. This error occurs because of the following reasons: you're trying to import an item from a ......
Read more >[Solution] Error: Cannot Find Module "nodemailer" - Courier
This error occurs when you have not installed the nodemailer library in your Node.js application. Solution - Here's How To Resolve It. First,...
Read more >module not found issue - Google Groups
Hi,. I just hosted my nodejs app on aws and got this weird error, I rechecked the files multiple times the file is...
Read more >Fix error: cannot find module 'x' in Node.js or 'express'
A quick fix to the error-cannot find module is to try and install all the presented module in your terminal correctly. Navigate to...
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
@danielroe The other issue (#886) is for “build”. This issue is when running “nuxi dev”.
Same issue here with
server.mjs
not found migrating fresh Nuxt2 project with bridge. Note, this is only happening ifssr: false
.