browserslist: Unknown version 59 of op_mob

const browserslist = require("browserslist");

console.log(browserslist(["op_mob 59"], {mobileToDesktop: true}));

fails with

Uncaught Error [BrowserslistError]: Unknown version 59 of op_mob
    at Function.select (.../node_modules/browserslist/index.js:1101:17)
    at .../node_modules/browserslist/index.js:336:33
    at Array.reduce (<anonymous>)
    at resolve (.../node_modules/browserslist/index.js:318:18)
    at browserslist (.../node_modules/browserslist/index.js:443:21)
console.log(browserslist(browserslist(['op_mob 46']))); // == [ 'op_mob 46' ]
console.log(browserslist(browserslist(['op_mob 47']))); // Error

This has come up because Parcel first does browserslist(["> 0.25%"]) with the query read from some npm package.json, and then passing the result to Babel which calls browserslist again (https://github.com/parcel-bundler/parcel/issues/5164#issuecomment-695348725)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 7
  • Comments: 28 (8 by maintainers)

Most upvoted comments

Opera 59 w never released. I will add a fix to mobileToDesktop.

I have nothing new to contribute here just wanted to confirm I am experiencing the same issue and none of the suggestions in this issue or here https://github.com/parcel-bundler/parcel/issues/5164 have worked so far. Thanks to everyone who is actively working on a solution.

The fix was released in 4.14.4

You deleted .parcel-cache, npm_modules, and package-lock.json (or yarn.lock), added the suggestions to your package.json?

Then ran npm install or yarn to reinstalled all the dependencies?

Using Yarn, this one worked for me:

"resolutions": {
  "browserslist": "4.14.2",
  "caniuse-lite": "1.0.30001129"
}

I used Parcel default for browserlist, which meant I didn’t include a .browserlistrc or anything related to it in package.json i.e. no where did I include not op_mob 59.

I should add, I also removed Parcel using npm uninstall parcel and made sure browerlist wasn’t installed anymore either, using npm ls to check if it was indeed removed (you can grep if need be.) Then I reinstalled it using yarn.

(if you wanted to use npm you’d do the same but, with the npm based suggestion from the other thread.)

Here is what I did in order to (temporarily) fix the issue:

  1. Deleted the .cache folder
  2. Added "not op_mob > 1" in the browserslist setting in my package.json file.
  3. Rebuilt the project

I am using parcel-bundler v.1.12.4