nextjs v9 babel config doesn't allow for certain browserlist queries
See original GitHub issueBug report
when upgrading from nextjs 8.x to 9.0.3 something about browserslist support inside the babel preset changed
Describe the bug
This error manifests: Cannot use 'in' operator to search for 'node' in >1% in US and not ie 11
for this babel config:
module.exports = {
presets: [
[
'next/babel',
{
'preset-env': {
targets: '>1% in US and not ie 11',
modules: false,
},
},
],
],
};
To Reproduce
Create a nextjs project with the above babel config
Expected behavior
The app compiles successfully
Screenshots
n/a
System information
- OS: macOS latest stable
- Browser (if applies) n/a
- Version of Next.js: 9.0.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (5 by maintainers)
Top Results From Across the Web
nextjs v9 babel config doesn't allow for certain browserlist ...
Bug report when upgrading from nextjs 8.x to 9.0.3 something about browserslist support inside the babel preset changed Describe the bug ...
Read more >Advanced Features: Customizing Babel Config - Next.js
To start, you only need to define a .babelrc file (or babel.config.js ) at the top of your app. If such a file...
Read more >babel/preset-env
By default @babel/preset-env will use browserslist config sources unless either the targets or ignoreBrowserslistConfig options are set.
Read more >Parsing error: Cannot find module '@babel/preset-react'
Try installing @babel/preset-react explicitly, since someone had told that ... Here's my full package.json (where there might be some mix up ...
Read more >eslint: failed to load config next/babel to extend from. - You.com ...
I was missing the package @vue/prettier/@typescript-eslint, after installing the package version matching my package.json, I was good. Hope that helps someone.
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
I can jump on this today. Babel only recently documented this syntax and we missed it in our initial work.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.