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.

Warning about browserslist and caniuse-lite

See original GitHub issue

Current 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:open
  • Created 2 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
titcommented, Apr 6, 2022
0reactions
dylnclrkcommented, Apr 22, 2022

@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.

Read more comments on GitHub >

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

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