Cannot start nuxt: Named export 'rollup' not found
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.12.0
- Nuxt Version:
3.0.0-27251455.110b2b2
- Package Manager:
npm
- Bundler:
Vite
- User Config:
css
,build
- Runtime Modules:
-
- Build Modules:
-
Describe the bug
Nuxt is not able to boot correctly
ERROR Cannot start nuxt: Named export 'rollup' not found. The requested module 'rollup' is a CommonJS module, which may not support all module.exports as named exports. 08:55:26
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'rollup';
const { rollup, watch: watch$1 } = pkg;
import { rollup, watch as watch$1 } from 'rollup';
^^^^^^
SyntaxError: Named export 'rollup' not found. The requested module 'rollup' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'rollup';
const { rollup, watch: watch$1 } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:181:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:784:37)
at async load (node_modules/nuxi/dist/chunks/dev.mjs:6714:25)
at async Object.invoke (node_modules/nuxi/dist/chunks/dev.mjs:6756:5)
at async _main (node_modules/nuxi/dist/chunks/index.mjs:385:7)
Reproduction
It is not necessary
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Cannot start nuxt: Named export 'rollup' not found. #1426
It was installed according to the official document of nuxt3, but yarn dev does not work normally. However, an error called ' ERROR...
Read more >'default' is not exported by node_modules/react/index.js ...
Finally I found what was wrong. I needed the @rollup/plugin-replace plugin to replace process.env.NODE_ENV. Here's the working code.
Read more >syntaxerror: the requested module 'fs' does not provide an ...
The modules don't seem to be working as expected. I'm running this through a local host server, using node and I just updated...
Read more >ES Modules · Nuxt Concepts
ES Modules. This guide helps explain what ES Modules are and how to make a Nuxt app (or upstream library) compatible with ESM....
Read more >Publish ESM and CJS in a single package
ESM enables named exports, better static analysis, tree-shaking, ... on CJS and the migration is not that easy, I found myself more lean...
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
There was a regression in rollup
@2.58.1
. Fix is being releasedin few minutesad7e7551ec8de64b300bd6b61432ce3290c76d3f in v3.0.0-27252573.ad7e755Also getting that new DeprecationWarning when running
npx nuxi info