parcel: BrowserslistError: Unknown version 59 of op_mob
🐛 bug report
I get the following error when build or serve:
Error: Unknown version 59 of op_mob
BrowserslistError: Unknown version 59 of op_mob
at Function.select (/home/username/Code/website/node_modules/browserslist/index.js:1101:17)
at /home/username/Code/website/node_modules/browserslist/index.js:336:33
at Array.reduce (<anonymous>)
at resolve (/home/username/Code/website/node_modules/browserslist/index.js:318:18)
at browserslist (/home/username/Code/website/node_modules/browserslist/index.js:443:21)
at getTargets (/home/username/Code/website/node_modules/@babel/helper-compilation-targets/lib/index.js:199:48)
at /home/username/Code/website/node_modules/@babel/preset-env/lib/index.js:258:57
at /home/username/Code/website/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at getNeededPlugins (/home/username/Code/website/node_modules/@parcel/transformer-babel/lib/env.js:47:33)
at shouldCompileFurther (/home/username/Code/website/node_modules/@parcel/transformer-babel/lib/env.js:55:31)
🎛 Configuration (.babelrc, package.json, cli command)
{
"name": "The Name",
"version": "1.0.0",
"description": "The desc.",
"scripts": {
"serve": "parcel serve ./src/index.html --dist-dir ./serve",
"build": "NODE_ENV=production parcel build ./src/index.html",
"postbuild": "cp -r static/* dist/"
},
"dependencies": {
"alpinejs": "^2.7.0",
"smoothscroll-anchor-polyfill": "^1.3.2",
"smoothscroll-polyfill": "^0.4.4",
"tailwindcss": "^1.8.10",
"typeface-fira-sans": "0.0.75",
"typeface-heebo": "0.0.72"
},
"devDependencies": {
"html-validate": "^3.3.0",
"parcel": "^2.0.0-beta.1"
}
}
🤔 Expected Behavior
Expected Parcel to build and serve
😯 Current Behavior
Not building or serving rather, errors.
💁 Possible Solution
If I was to guess, maybe browserslist needs an update? Or babel?
🔦 Context
I’m unable to build or serve.
I Googled and Issue searched here but, not sure how to address, sorry.
💻 Code Sample
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | ^2.0.0-beta.1 |
Node | v14.6.0 |
npm/Yarn | 6.14.7 |
Operating System | Manjaro Linux |
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 22 (7 by maintainers)
Commits related to this issue
- limit table width in Chrome browser Build is currently broken due to https://github.com/parcel-bundler/parcel/issues/5164 — committed to yoursunny/NDNts-NFD-status-page by yoursunny 4 years ago
- fix(env): `BrowserslistError: Unknown version 59 of op_mob` を修正した ref: https://github.com/parcel-bundler/parcel/issues/5164 — committed to decomoji/conjugator by oti 4 years ago
In my case downgrading only
browserslist
for yarn does not help, I had to downgrade alsocaniuse-lite
.This is fixed in Browserslist 4.14.4.
I temporarily fixed the issue with yarn: add this to package.json
and then
yarn
To solve it, at least temporarily, you can exclude the op_mob 59 by adding a extra rule to .browserslistrc The extra rule is:
not op_mob 59
My .browserslistrc file that avoid this issue is the next:
I use
npm install
and fixed. i add this script topackage.json
.thanks https://github.com/parcel-bundler/parcel/issues/5164#issuecomment-695793929
manual update browserslist to 4.14.5
@mischnic
Thanks guys!
I can confirm on Parcel V2 (2.0.0-beta.1) @SolomoN-ua’s solution worked and kirzka’s did not.
I should note that I installed Browserlite 4.14.2 directly in dependencies but, that didn’t work. Good call on the cainuse-lite.
Of course, being new, I wasn’t aware there was a resolutions field. Looks like it’s only for Yarn, which I’ve been considering switching to.
Yarn Selective Version Resolutions
There does, however, appear to be a package that adds this feature to NPM (not sure I had it setup properly, as I was unable to get this to work; the Yarn Resolutions did work, however.)
NPM Force Resolutions
Anyway, thanks again!
P.s. the awesome @mischnic is making progress on this over at Browserlist:
https://github.com/browserslist/browserslist/issues/537
Looks like it’s going to be addressed, which is awesome.
And there is also another possible temporary work around (so far hasn’t worked for me on Parcel V2, however):
https://github.com/browserslist/browserslist/issues/537#issuecomment-695764493