Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nextjs error when first run: Error: Cannot find module 'caniuse-lite/data/features/css-unicode-bidi'

I got error when start my nextjs project, here's the error

error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[8].use[2]!./styles/globals.css

Error: Cannot find module 'caniuse-lite/data/features/css-unicode-bidi'

and got this require stack

Require stack:

- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/compiled/postcss-preset-env/index.cjs
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/build/webpack/config/blocks/css/index.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/build/webpack/config/index.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/build/webpack-config.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/server/dev/hot-reloader.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/server/dev/next-dev-server.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/server/next.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/server/lib/start-server.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/cli/next-dev.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/lib/commands.js
- /home/ragil/Documents/study/framework/testing/node_modules/next/dist/bin/next

I've tried to install next js with yarn and npm but still i got this problem

like image 347
user15194898 Avatar asked Sep 04 '25 17:09

user15194898


1 Answers

This is an issue with caniuse-lite which was introduced in v1.0.30001394 and fixed in v1.0.30001397. See browserslist/caniuse-lite#100.

To fix it, update to latest version.

npm install [email protected]
like image 65
juliomalves Avatar answered Sep 06 '25 14:09

juliomalves