Recently, when I compile my scss files I get an error. The error message says:
Browserslist: caniuse-lite is outdated. Please run next command
npm update caniuse-lite browserslist
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 and installed again, also I updated the whole folder by npm update
but none of them solved the issue.
I also reinstalled autoprefixer and browserslist but none of them solved the issue.
If I remove
"options": {
"autoPrefix": "> 1%"
}
from my compilerconfig.json
, everything works fine which means probably it is related to autoprefixer. Also, I manually changed the package version to the latest version on package.json
and reinstalled but no luck.
npx update-browserslist-db@latest updates caniuse-lite version in your npm, yarn or pnpm lock file. This update will bring data about new browsers to polyfills tools like Autoprefixer or Babel and reduce already unnecessary polyfills.
caniuse-lite then, is a smaller dataset that keeps essential parts of the data in a compact format. It does this in multiple ways, such as converting null array entries into empty strings, representing support data as an integer rather than a string, and using base62 references instead of longer human-readable keys.
What is Browserslist? Browserslist is a tool that allows specifying which browsers should be supported in your frontend app by specifying "queries" in a config file. It's used by frameworks/libraries such as React, Angular and Vue, but it's not limited to them.
Try this it solved my problem npx browserslist@latest --update-db
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With