3

This error started appearing in the build task "Run Code Analysis" for a web project build. I have performed the command npx browserslist@latest --update-db, but it did not resolve the issue.

The "Run Code Analysis" appears to complete. Any suggestions on how I can get rid of the message concerning "caniuse-lite is outdated"?

##[error]ERROR: Browserslist: caniuse-lite is outdated. Please run:
ERROR: Browserslist: caniuse-lite is outdated. Please run:
##[error]ERROR: npx browserslist@latest --update-db
ERROR: npx browserslist@latest --update-db
ERROR: 
ERROR: Why you should do it regularly:
ERROR: https://github.com/browserslist/browserslist#browsers-data-updating
Palec
  • 12,743
  • 8
  • 69
  • 138
J. Cortese
  • 61
  • 6

2 Answers2

5

I don't know how I can fix that with a good approach, but for now I suppressed this warning by adding the variable to AzureDevops BROWSERSLIST_IGNORE_OLD_DATA=true.

variables:
  ...
  - name: 'BROWSERSLIST_IGNORE_OLD_DATA'
    value: true
  ...
mr_alex
  • 224
  • 1
  • 6
1

This is an issue with the CSS and JS analyzers of SonarQube. It has already been fixed. The CSS analyzer has been merged into the JS analyzer since then.

The fix has been released as part of SonarJS 8.9.0.17411, which was released as part of SonarQube 9.4.

As a workaround, you can set the environment variable BROWSERSLIST_IGNORE_OLD_DATA to true. This is what the analyzer fix does, anyway, just very locally. The easiest way to set an environment variable is to create a pipeline variable of the same name. Just keep in mind that if you use NPM package browserlist in your own code, the warning will be suppressed there too.

Palec
  • 12,743
  • 8
  • 69
  • 138