question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nextjs v9 babel config doesn't allow for certain browserlist queries

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
developitcommented, Aug 6, 2019

I can jump on this today. Babel only recently documented this syntax and we missed it in our initial work.

0reactions
balazsorban44commented, Jan 31, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found