Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db NextJS

Tags:

next.js

When I run my NextJs program this error always pops up

Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

So then I run npx browserslist@latest --update-db in the shell:

npx: installed 6 in 1.905s
Current version: 1.0.30001179
New version:     1.0.30001179
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

And the I when I run my Next program again, the same error occurs. This started happening to me yesterday. I just used npx create-next-app and the npm run dev.

like image 543
Aidenhsy Avatar asked Jan 25 '21 03:01

Aidenhsy


People also ask

What is NPX Browserslist latest -- update DB?

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.

What is Browserslist caniuse-lite?

GitHub - browserslist/caniuse-lite: A smaller version of caniuse-db, with only the essentials! Skip to content Toggle navigation. Product. Actions. Automate any workflow.

What is Browserslist in package JSON?

The config to share target browsers and Node.js versions between different front-end tools. It is used in: Autoprefixer. Babel.


1 Answers

UPDATE

The new version (10.0.6) has been released few moments ago. No warnings present.


This is a falsy warning in current Next.js version (10.0.5).

It's already solved in canary version, which is a base for the next stable version. You can install it (npm install next@canary or yarn add next@canary) and make sure there are no warnings.

Since canary version is not recommended for using in production, you can continue working in 10.0.5 without any side effects. The warning will disappear after new stable version release.

like image 167
yura3d Avatar answered Oct 12 '22 18:10

yura3d