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.

Production build doesn't work on fresh Nuxt3 project

See original GitHub issue

Environment


  • 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:

  1. yarn build
  2. yarn start
  3. See error

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
pi0commented, Oct 12, 2021

Oh, i see. starter template needed updating! https://github.com/nuxt/starter/commit/e22b188712d28fbc87cca9000f52964d94aae289

Closing issue. Happy Nuxting 😉

1reaction
proskurindimacommented, Oct 12, 2021

@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.

Read more comments on GitHub >

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

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