When I build my app I get prompted (several times) to run npx browserslist@latest --update-db
. However, when I do I get an error TypeError: Cannot read properties of undefined (reading 'replace')
Steps to reproduce
git clone [email protected]:captbaritone/webamp.git
cd webamp
yarn
npx browserslist@latest --update-db
Actual outcome
╭─[00:00]: captbaritone at moffo in ~/tmp/webamp on branch*
╰─➤ npx browserslist@latest --update-db
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
Latest version: 1.0.30001412
/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:155
? lines[3].replace(
^
TypeError: Cannot read properties of undefined (reading 'replace')
at /Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:155:22
at Array.forEach (<anonymous>)
at updateYarnLockfile (/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:141:10)
at updateLockfile (/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:226:12)
at updatePackageManually (/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:232:22)
at updateDB (/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/update-db.js:327:5)
at Object.<anonymous> (/Users/captbaritone/tmp/webamp/node_modules/@babel/core/node_modules/browserslist/cli.js:42:3)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
Node.js v18.7.0
Versions
╭─[00:00]: captbaritone at moffo in ~/tmp/webamp on branch*
╰─➤ node --version
v18.7.0
╭─[00:00]: captbaritone at moffo in ~/tmp/webamp on branch*
╰─➤ yarn --version
1.22.10
╭─[00:00]: captbaritone at moffo in ~/tmp/webamp on branch*
╰─➤ npm --version
8.15.0
╭─[00:00]: captbaritone at moffo in ~/tmp/webamp on branch*
╰─➤ npx --version
8.15.0
Observation
I was prompted to report this issue here via this tweet but in filing this issue I realized that the command I was prompted to run npx browserslist@latest --update-db
is different than the on in this repository's readme, which is: npx update-browserslist-db@latest
.
If I run npx update-browserslist-db@latest
I get a better outcome (full output of that can be found in this gist)