Production build doesn't work on fresh Nuxt3 project
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.17.1
- Nuxt Version:
3-3.0.0-27234133.44f8904
- Package Manager:
Yarn
- Bundler:
Webpack
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Describe the bug and expected behavior
When running “yarn start”, the following error occurs: ` yarn run v1.22.10 $ node .output/server internal/modules/cjs/loader.js:905 throw err; ^
Error: Cannot find module ‘/home/user/projects/project/.output/server’ at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: ‘MODULE_NOT_FOUND’, requireStack: [] } `
In this case, the command before “yarn build” is executed without errors. Folder “.output/server” generated, it contains the index.mjs file.
A similar problem is observed when using npm
Steps to reproduce
Steps to reproduce the behavior:
- yarn build
- yarn start
- See error
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
nuxt.js - Not able to preview NuxtJs3 build - Stack Overflow
My Nuxt 3 Project is suddenly giving me some error after release of ... i run build command, it doesn't throw any error,...
Read more >Commands and Deployment - Nuxt
nuxt dev - Launch the development server. nuxt build - Build and optimize your application with webpack for production. nuxt start - Start...
Read more >How to deploy Nuxt application to server. Production mode on.
Lets create a Nuxt.js application first. Open a new terminal (to keep server terminal, open new one) and change its directory destination to...
Read more >Nuxt 3 full course build and deploy | #Nuxtjs #vue #nuxt3
Learn #nuxtjs with all its new features in the # nuxt3 applicationnuxt 3 Course is for beginners and cover full course to advanced...
Read more >Build and deploy a Nuxt3 application to Netlify - CircleCI
Installs and caches the project dependencies; Builds ( npm run generate ) and caches the .output/public directory, which holds the production ...
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
Oh, i see. starter template needed updating! https://github.com/nuxt/starter/commit/e22b188712d28fbc87cca9000f52964d94aae289
Closing issue. Happy Nuxting 😉
@pi0 Hi! Yes, this file exists.
But when i run “yarn start” the loader does not see it. I’ll clarify that I have not modified any files, this is the first launch of the fresh project.
If I start file directly, as I mentioned @takacspeter, everything works as expected.