打包报错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(),
]


相关文章
|
6天前
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
132 0
|
6天前
报错/ ./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)怎么解决?
|
6天前
Module build failed (from ./node_modules/eslint-loader/index.js)
Module build failed (from ./node_modules/eslint-loader/index.js)
128 0
Module build failed (from ./node_modules/eslint-loader/index.js)
|
6天前
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.
24 2
|
6月前
|
资源调度
Cannot find module ‘\node_modules\ejs\postinstall.js
Cannot find module ‘\node_modules\ejs\postinstall.js
44 0
|
6天前
./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问题
|
5月前
【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
|
6月前
|
JavaScript
Node.js Error: Cannot find module express
Node.js Error: Cannot find module express
|
6月前
解决 Error: ENOENT: no such file or directory, scandir ‘..\node_modules\node-sass\vendor‘
解决 Error: ENOENT: no such file or directory, scandir ‘..\node_modules\node-sass\vendor‘
105 0
|
6月前
|
资源调度 JavaScript Linux
Cannot find module ‘xxx\node_modules\yorkie\bin\install.js‘
Cannot find module ‘xxx\node_modules\yorkie\bin\install.js‘
64 0