Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update browserlist with npx browserslist@latest --update-db on yarn 2+ #31918

Closed
MonstraG opened this issue Nov 29, 2021 · 4 comments · Fixed by #32064 or #32300
Closed

Can't update browserlist with npx browserslist@latest --update-db on yarn 2+ #31918

MonstraG opened this issue Nov 29, 2021 · 4 comments · Fixed by #32064 or #32300
Labels
bug Issue was opened via the bug report template.

Comments

@MonstraG
Copy link
Contributor

What version of Next.js are you using?

12.0.4

What version of Node.js are you using?

16.13.0

What browser are you using?

n/a

What operating system are you using?

windows

How are you deploying your application?

n/a

Describe the Bug

When running yarn 2+ project, I recieve a warning "Browserslist: caniuse-lite is outdated", which tells me to run
npx browserslist@latest --update-db to update the browserlist.

Running the command gives:

node:child_process:903
    throw err;
    ^

Error: Command failed: yarn info caniuse-lite --json
    stacktrace...

Googling around, I find this issue in browserlist, turns out this command fails in yarn 2+ projects, and fix was released in browserlist 4.17.

Looking into my yarn.lock, I find:

"next@npm:^12.0.4":
  version: 12.0.4
  resolution: "next@npm:12.0.4"
  dependencies:
    ...
    browserslist: 4.16.6

So, I'm pretty sure the solution to this bug is to update browserlist to 4.17.

(I'm not sure if this is the correct template, sorry in advance)

Expected Behavior

I can update browserlist and get rid of the warning

To Reproduce

Create a yarn 2+ project, try updating browserlist with command above.

@MonstraG MonstraG added the bug Issue was opened via the bug report template. label Nov 29, 2021
@ijjk
Copy link
Member

ijjk commented Dec 8, 2021

Hi, this has been updated in v12.0.8-canary.2 of Next.js, please update and give it a try!

@MonstraG
Copy link
Contributor Author

MonstraG commented Dec 8, 2021

Doesn't look like it?
Updated next to 12.0.8-canary.2 (onl;y change made in package.lock), here's how yarn.lock looks like:

"next@npm:^12.0.8-canary.2":
  version: 12.0.8-canary.2
  resolution: "next@npm:12.0.8-canary.2"
  dependencies:
	...
    browserslist: 4.16.6
	...
    caniuse-lite: ^1.0.30001228

Runnuing npx browserslist@latest --update-db still gives the same

node:child_process:903
   throw err;
   ^

Error: Command failed: yarn info caniuse-lite --json
   at checkExecSyncError (node:child_process:826:11)
   at Object.execSync (node:child_process:900:15)
   at getLatestInfo ([...]\node_modules\browserslist\update-db.js:48:20)
   at updateDB ([...]\node_modules\browserslist\update-db.js:202:16)
   at Object.<anonymous> ([...]\node_modules\browserslist\cli.js:40:3)
   ...stracktrace continues...

When running project, browserlist still asks to update:

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

@ijjk
Copy link
Member

ijjk commented Dec 8, 2021

The error from running npx browserlist seems to be unrelated to Next.js possibly related to browserslist/browserslist#577 but will look at landing the update in #31984 to ensure it's unrelated to that

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
3 participants