起始VUE JS开发服务器给出错误:.plugins [0]可以仅是两元组或三元组
我使用Vue的CLI版本3跑码头工人,容器内的Vue公司的应用程序。要启动开发服务器,我运行:
.html
这提供了以下错误:
ERROR Failed to compile with 1 errors 17:05:14
error in ./app/main.js
Module build failed (from ./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js):
Error: .plugins[0] may only be a two-tuple or three-tuple
at assertPluginItem (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:235:13)
at arr.forEach (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:222:30)
at Array.forEach (<anonymous>)
at assertPluginList (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:222:9)
at Object.keys.forEach.key (/home/src/node_modules/@babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/home/src/node_modules/@babel/core/lib/config/validation/options.js:83:21)
at validate (/home/src/node_modules/@babel/core/lib/config/validation/options.js:74:10)
at file (/home/src/node_modules/@babel/core/lib/config/config-chain.js:174:34)
at cachedFunction (/home/src/node_modules/@babel/core/lib/config/caching.js:33:19)
at buildRootChain (/home/src/node_modules/@babel/core/lib/config/config-chain.js:120:36)
at loadPrivatePartialConfig (/home/src/node_modules/@babel/core/lib/config/partial.js:85:55)
at Object.loadPartialConfig (/home/src/node_modules/@babel/core/lib/config/partial.js:110:18)
at Object.<anonymous> (/home/src/node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:140:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/src/node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:3:103)
@ multi (webpack)-dev-server/client/index.js ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./app/main.js
我怀疑有问题的代码如下,在我.babelrc
文件:
"plugins": [
["transform-runtime", "transform-vue-jsx", "transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
可能有人建议我怎么能去解决呢?谢谢!
回答如下:你[
是放错了地方。它应该是
"plugins": [
"transform-runtime",
"transform-vue-jsx",
["transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
]
起始VUE JS开发服务器给出错误:.plugins [0]可以仅是两元组或三元组
我使用Vue的CLI版本3跑码头工人,容器内的Vue公司的应用程序。要启动开发服务器,我运行:
.html
这提供了以下错误:
ERROR Failed to compile with 1 errors 17:05:14
error in ./app/main.js
Module build failed (from ./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js):
Error: .plugins[0] may only be a two-tuple or three-tuple
at assertPluginItem (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:235:13)
at arr.forEach (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:222:30)
at Array.forEach (<anonymous>)
at assertPluginList (/home/src/node_modules/@babel/core/lib/config/validation/option-assertions.js:222:9)
at Object.keys.forEach.key (/home/src/node_modules/@babel/core/lib/config/validation/options.js:107:5)
at Array.forEach (<anonymous>)
at validateNested (/home/src/node_modules/@babel/core/lib/config/validation/options.js:83:21)
at validate (/home/src/node_modules/@babel/core/lib/config/validation/options.js:74:10)
at file (/home/src/node_modules/@babel/core/lib/config/config-chain.js:174:34)
at cachedFunction (/home/src/node_modules/@babel/core/lib/config/caching.js:33:19)
at buildRootChain (/home/src/node_modules/@babel/core/lib/config/config-chain.js:120:36)
at loadPrivatePartialConfig (/home/src/node_modules/@babel/core/lib/config/partial.js:85:55)
at Object.loadPartialConfig (/home/src/node_modules/@babel/core/lib/config/partial.js:110:18)
at Object.<anonymous> (/home/src/node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:140:26)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/src/node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib/index.js:3:103)
@ multi (webpack)-dev-server/client/index.js ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./app/main.js
我怀疑有问题的代码如下,在我.babelrc
文件:
"plugins": [
["transform-runtime", "transform-vue-jsx", "transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
可能有人建议我怎么能去解决呢?谢谢!
回答如下:你[
是放错了地方。它应该是
"plugins": [
"transform-runtime",
"transform-vue-jsx",
["transform-regenerator", {
"polyfill": false,
"regenerator": true
}]
]