Error: .plugins[0][1] must be an object, false, or undefined
See original GitHub issueI’ve updated Next from version 5 to 6 and on build
I get:
Error: .plugins[4][1] must be an object, false, or undefined
at assertPluginItem (/node_modules/@babel/core/lib/config/validation/option-assertions.js:157:15)
at /node_modules/@babel/core/lib/config/validation/option-assertions.js:134:14
at Array.forEach (<anonymous>)
at assertPluginList (/node_modules/@babel/core/lib/config/validation/option-assertions.js:133:9)
at /node_modules/@babel/core/lib/config/validation/options.js:84:20
at Array.forEach (<anonymous>)
at validate (/node_modules/@babel/core/lib/config/validation/options.js:62:21)
at /node_modules/@babel/core/lib/config/config-chain.js:141:36
at cachedFunction (/node_modules/@babel/core/lib/config/caching.js:40:17)
at init (/node_modules/@babel/core/lib/config/config-chain.js:122:12)
at /node_modules/@babel/core/lib/config/config-chain.js:206:17
at buildRootChain (/node_modules/@babel/core/lib/config/config-chain.js:85:20)
at loadPrivatePartialConfig (/node_modules/@babel/core/lib/config/partial.js:41:53)
at loadPartialConfig (/node_modules/@babel/core/lib/config/partial.js:66:16)
at babelConfig (/node_modules/next/dist/server/build/webpack.js:88:57)
at _callee2$ (/node_modules/next/dist/server/build/webpack.js:164:34)
My babel deps are:
"babel-eslint": "^8.2.3",
"babel-plugin-inline-react-svg": "^0.5.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-env": "^1.6.1",
"babel-root-import": "^4.1.8",
"markdown-in-js": "1.1.4",
.babelrc
{
"presets": [
"env",
"next/babel"
],
"plugins": [
"markdown-in-js/babel",
"inline-react-svg",
"transform-decorators-legacy",
"transform-class-properties",
["babel-root-import", [{
"rootPathPrefix": "~",
"rootPathSuffix": "."
}, {
"rootPathPrefix": "$",
"rootPathSuffix": "app"
}, {
"rootPathPrefix": "#",
"rootPathSuffix": "shared"
}]]
]
}
Tech | Version |
---|---|
next | 6 |
node | v8.9.3 |
OS | macOS H.S. |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Plugins[0][1] must be an object, false, or undefined
I suspect the issue is related to the .babelrc file as it is a babel-loader error being thrown. .babelrc { "presets": [ ], ......
Read more >build failed due to babelrc, presets[0] [1] must be an object ...
Coding example for the question build failed due to babelrc, presets[0] [1] must be an object, false or undefined-babel.js.
Read more >Error: .plugins[0][1] must be an object, false, or undefined
vue2.0+按需引入element-ui报错项目使用vue脚手架自动生成的,vue版本为^2.5.16.项目中需要按需使用element-ui,根据element-ui的官方文档, ...
Read more >Error: .plugins[0][1] must be an object, false, or undefined
vue2.0+按需引入element-ui报错项目使用vue脚手架自动生成的,vue版本为^2.5.16.项目中需要按需使用element-ui,根据element-ui的官方文档, ...
Read more >Console error "WeakMap key must be an object, got ...
I'm seeing this error in the browser console, it appears to happen every time a new tab is created: WeakMap key must be...
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
@foxhound87 did
babel-upgrade
installbabel-core": "^7.0.0-bridge.0
? I don’t see it in your list, and I’m pretty sure it’s absence will muck with the non-scoped packages (e.g.babel-eslint
)I updated to next 7 and the babel deps using
babel-upgrade
, the app is building and running correctly locally (also in docker container, using nanobox), but when deployed (same environment) I get the usual error:This is my new
babel.config.js
:I’m not using all the plugins installed by
babel-upgrade
. Just what I need.the packages installed by
babel-upgrade
indevDependencies
are:really can’t understand what’s still wrong! This error is still preventing me to update next. I also reduced the number of the plugins used in the babel config file.