nuxt/vite

Dev Server crashes with error

IshanKBG opened this issue · 4 comments

Versions

nuxt-vite: 0.3.1
nuxt: 2.15.7

Reproduction

Tried clean installing
Error is caused when running yarn dev
repo

Description

Whenever i run the local dev server with nuxt-vite i get this error

require() of ES Module /home/ishan/ishan-projects/ishankbg/node_modules/p-debounce/index.js from /home/ishan/ishan-projects/ishankbg/node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js not supported.
Instead change the require of index.js in /home/ishan/ishan-projects/ishankbg/node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js to a dynamic import() which is available in all CommonJS modules.

  Instead change the require of index.js in node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js to a dynamic import() which is available in all CommonJS modules.
  at Object.<anonymous> (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:10:19)
  at node_modules/nuxt-vite/dist/nuxt-vite.js:56:79
  at async node_modules/nuxt-vite/dist/nuxt-vite.js:56:29


   ╭──────────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                          │
   │   ✖ Nuxt Fatal Error                                                                     │
   │                                                                                          │
   │   Error [ERR_REQUIRE_ESM]: require() of ES Module                                        │
   │   /home/ishan/ishan-projects/ishankbg/node_modules/p-debounce/index.js from              │
   │   /home/ishan/ishan-projects/ishankbg/node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js   │
   │   not supported.                                                                         │
   │   Instead change the require of index.js in                                              │
   │   /home/ishan/ishan-projects/ishankbg/node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js   │
   │   to a dynamic import() which is available in all CommonJS modules.                      │
   │                                                                                          │
   ╰──────────────────────────────────────────────────────────────────────────────────────────╯

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

Before upgrading it was working fine but now i am getting this error.

Same issue.

pi0 commented

Hi, @IshanKBG Issue related to p-debounce is resolved in nuxt-vite@^0.3.2. However, in your reproduction, there seems another issue seems related to the content module:

Cannot find module 'html' from '/tmp/ishankbg-web'
Object.$id_882dd793 [as /node_modules/property-information/index.js]
Object.$id_1aea1528 [as /.nuxt/content/nuxt-content.js]

@toniengelhardt Would you please upgrade to 0.3.2 to see if solved your issue and creating a new issue with reproduction info if still having issues with 0.3.x?

pi0 commented

Closing second issue in favor of #215

Upgrading resolved it for me @pi0 thanks!