Warning about browserslist and caniuse-lite
See original GitHub issueCurrent behavior
Running cypress usually shows a warning about browserslist and caniuse-lite⦠even when the recommended command is run immediately before Cypress
Example output below:
% yarn run test-record
yarn run v1.22.17
$ npx --yes browserslist@latest --update-db && yarn run cypress run --record --key <redacted>
Latest version: 1.0.30001303
Installed version: none
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ yarn add -W caniuse-lite
Cleaning package.json dependencies from caniuse-lite
$ yarn remove -W caniuse-lite
caniuse-lite has been successfully updated
No target browser changes
$ <redacted>/node_modules/.bin/cypress run --record --key <redacted>
====================================================================================================
(Run Starting)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 9.3.1 β
β Browser: Electron 94 (headless) β
β Node Version: v16.13.2 (/usr/local/bin/node) β
β Specs: <redacted> β
β Params: Tag: false, Group: false, Parallel: false β
β Run URL: https://dashboard.cypress.io/projects/<redacted> β
β Experiments: experimentalStudio=true β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Running: <redacted> (1 of 25)
Estimated: 1 minute, 3 seconds
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Desired behavior
Cypress should manage its dependencies in such a way as to avoid this warning occurring.
Test code to reproduce
https://github.com/zaq42/cypress-test-tiny/tree/caniuse-lite-is-outdated
command:
npm run cypress:run
output:
Zaq42/cypress-test-tiny master % npm run cypress:run
> cypress-test-tiny@1.0.0 cypress:run
> npx --yes browserslist@latest --update-db && cypress run
Latest version: 1.0.30001303
Installed version: none
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ npm install caniuse-lite
Cleaning package.json dependencies from caniuse-lite
$ npm uninstall caniuse-lite
caniuse-lite has been successfully updated
No target browser changes
====================================================================================================
(Run Starting)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 9.3.1 β
β Browser: Electron 94 (headless) β
β Node Version: v16.13.2 (/usr/local/bin/node) β
β Specs: 1 found (spec.js) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Running: spec.js (1 of 1)
Browserslist: caniuse-lite is outdated. Please run: <------------- Annoying warning
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
page
β works (674ms)
1 passing (2s)
(Results)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Tests: 1 β
β Passing: 1 β
β Failing: 0 β
β Pending: 0 β
β Skipped: 0 β
β Screenshots: 0 β
β Video: true β
β Duration: 2 seconds β
β Spec Ran: spec.js β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
(Video)
- Started processing: Compressing to 32 CRF
- Finished processing: /Users/Dave/src/Zaq42/cypress-test-tiny/cypress/videos/spec (1 second)
.js.mp4
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β spec.js 00:02 1 1 - - - β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β All specs passed! 00:02 1 1 - - -
Zaq42/cypress-test-tiny master %
Cypress Version
9.3.1
Other
The browserslist project has at least 24 issues raised around this particular problem.
Other projects are dealing with similar complaints. E.g. SonarSource
SUGGESTION
The warning can be suppressed by setting BROWSERSLIST_IGNORE_OLD_DATA=true
For example:
"cypress:run": "BROWSERSLIST_IGNORE_OLD_DATA=true cypress run",
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
caniuse-lite is outdated. Please run next command `npm ...
First, as the message says, I ran npm update caniuse-lite browserslist but it didn't fix the issue. I deleted the whole node_modules directoryΒ ......
Read more >caniuse-lite is outdated. Please run: npx browserslist@latest ...
The problem, to me, is that browserslist - the tool, not the people behind it - is incorrectly assuming that a node project...
Read more >ERROR: Browserslist: caniuse-lite is outdated - SonarQube
The ERRORS flagged we think that must be flagged as Warnings, cause the Analysis complete successful.Nothing has changed in our side, noΒ ...
Read more >caniuse-lite - npm
Start using caniuse-lite in your project by running `npm i caniuse-lite`. There are 1076 other projects in the npm registry using caniuse-lite.
Read more >Caniuse-lite is outdade, please run `npx browserslist@latest
Caniuse -lite is outdade, please run `npx browserslist@latest --update-db`. While running commands in an NX workspace, this warning keptΒ ...
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
@begner You are Superman!
Cypress installation folder: https://docs.cypress.io/guides/getting-started/installing-cypress#Binary-cache
@begner gotcha, thanks. And thank you for sharing the workaround!
I think the Cypress binay is an Electron app, so I was just wondering if the browserlist/caniuse-lite dependency is Cypress specific, or if itβs an issue with Electron/the version of Electron used by Cypress.