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.

browserslist target throws when Babel can understand it

See original GitHub issue

Bug report

What is the current behavior?

Using the following .browserslistrc that was generated a few weeks back with npx browserslist --mobile-to-desktop "> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11" throws.

and_chr 91
and_ff 89
and_qq 10.4
and_uc 12.12
android 91
baidu 7.12
chrome 90
edge 91
firefox 78
ios_saf 12.4
kaios 2.5
op_mini all
op_mob 76
opera 76
safari 14
samsung 13.0

If the current behavior is a bug, please provide the steps to reproduce.

$ git clone https://github.com/eps1lon/webpack-targets-browserslist
$ yarn
$ yarn start

What is the expected behavior?

Webpack is able to understand this browserlist since Babel is able to. See https://github.com/babel/babel/issues/12123 for more context.

Other relevant information: webpack version: 5.52.0 Node.js version: 12.22.6 Operating System: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa) Additional tools: browserslist@4.17.0, caniuse-lite@1.0.30001255

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Sep 11, 2021

Because mobileToDesktop is a specific Babel hack. It could leads to compatibility data losses for other tool

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/preset-env
@babel/preset-env takes any target environments you've specified and checks them against its mappings to compile a list of plugins and passes it to...
Read more >
Why same browserslist option makes different target results
I 'm using browserslist option on package.json in two projects. One is react, and the other is next.js project. But I could find...
Read more >
How to create a custom .browserlistrc for babel-preset-env
After you run the tool it'll generate a browserslist-stats.json giving you all the stats in a nice JSON file that Babel can understand....
Read more >
How babel preset-env, core-js, and browserslistrc work together
Given modern JavaScript syntax as input, babel is able to transform it to compatible code that can run in any browser. To start...
Read more >
@babel/preset-env - npm
If targets.browsers is not defined - the program will search browserslist file or package.json with browserslist field. The search will start ...
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