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.

Could not load .nuxt/dist/server/server.mjs when using ssr false and webpack

See original GitHub issue

Environment


  • Operating System: Linux
  • Node Version: v14.18.2
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: yarn@1.22.19
  • Builder: webpack
  • User Config: builder, ssr
  • Runtime Modules: -
  • Build Modules: -

Reproduction

  • npx nuxi init nuxt-app
  • cd nuxt-app
  • yarn add -D @nuxt/webpack-builder
  • add to nuxt.config.js: builder: 'webpack' and ssr: false
  • yarn build

Describe the bug

yarn run v1.22.19
$ nuxt build
Nuxt CLI v3.0.0-rc.3                                                                                                                                                                                                                            15:58:12
✔ Generated public .output/public                                                                                                                                                                                                         nitro 15:58:23
ℹ Initializing prerenderer                                                                                                                                                                                                                nitro 15:58:23

 ERROR  Rollup error: Could not load /home/gustavo/nuxt-app/.nuxt/dist/server/server.mjs: ENOENT: no such file or directory, open '/home/gustavo/nuxt-app/.nuxt/dist/server/server.mjs'                                                   nitro 15:58:23


 ERROR  Could not load /home/gustavo/nuxt-app/.nuxt/dist/server/server.mjs: ENOENT: no such file or directory, open '/home/gustavo/nuxt-app/.nuxt/dist/server/server.mjs'                                                                       15:58:23



error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
joel-wenzelcommented, May 20, 2022

I get this using vite and ssr false as well. Setting ssr to true, starting the server so server.mjs generates. Then stopping and setting ssr back to false and finally starting again does seem to be a workaround

0reactions
louismorgnercommented, Jul 6, 2022

Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Server-side Rendered Vue.js Apps Using Nuxt.js
Open your browser to localhost:3000 and your project should be running. Not much different from creating a Vue Webpack project. However, when we...
Read more >
Enabling assets for Server-Side Rendering in Webpack
This solves the problem for static assets. However, this does not yet work for styles. Introducing fake-style-loader. fake-style-loader enables loading CSS ...
Read more >
Nuxt configuration file
By default, Nuxt is configured to cover most use cases. This default configuration can be overwritten with the nuxt.config.js file.
Read more >
Headless Chrome: an answer to server-side rendering JS sites
In a couple of lines of code you can SSR any page and get its ... If you're in Node, Puppeteer is an...
Read more >
Configuring SSR - Quasar Framework
quasar/app-webpack) How to manage your server-side rendered apps with Quasar CLI. ... ssr: { pwa: true/false, // should a PWA take over (default:...
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