打包报错Error: ‘default‘ is not exported by node_modules/qs/lib/index.js

简介: 打包报错Error: ‘default‘ is not exported by node_modules/qs/lib/index.js

问题描述:

当我们在使用rollup编译es6时,可能会遇到以下报错问题

Error: 'default' is not exported by node_modules\jquery\dist\jquery.js, imported by node_modules\bootstrap\js\src\util.js

解决方案:

  • 安装@rollup/plugin-commonjs插件
npm install @rollup/plugin-commonjs --save-dev

最后,修改rollup.config.js文件中写入以下代码即可

import commonjs from '@rollup/plugin-commonjs'
plugins: [
   commonjs(),
]


相关文章
|
5月前
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
364 0
|
5月前
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
报错/ ./node_modules/axios/lib/platform/index.js Module parse failed: Unexpected token (5:2)怎么解决?
|
2月前
error in ./node_modules/@intlify/core-base/dist/core-base.cjs
error in ./node_modules/@intlify/core-base/dist/core-base.cjs
77 2
|
11月前
|
资源调度
Cannot find module ‘\node_modules\ejs\postinstall.js
Cannot find module ‘\node_modules\ejs\postinstall.js
110 0
|
5月前
Module build failed (from ./node_modules/eslint-loader/index.js)
Module build failed (from ./node_modules/eslint-loader/index.js)
179 0
Module build failed (from ./node_modules/eslint-loader/index.js)
|
5月前
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
67 2
|
11月前
|
JavaScript
Node.js Error: Cannot find module express
Node.js Error: Cannot find module express
|
5月前
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
|
10月前
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
【Error】This dependency was not found: * core-js/modules/es.error.cause.js in ./node_modules/@babel
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘
1089 0
node Express.js node:internal/modules/cjs/loader:988 throw err; ^ Error: Cannot find module ‘