emotion-js / emotion

👩‍🎤 CSS-in-JS library designed for high performance style composition
https://emotion.sh/
MIT License
17.5k stars 1.11k forks source link

(React 19) Failing `npm i` without --legacy-peer-deps flag #3187

Open RC-Pella opened 6 months ago

RC-Pella commented 6 months ago

Current behavior: npm install fails without --legacy-peer-deps flag due to emotion packages.

npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @emotion/react@11.11.4
npm ERR! Found: react@19.0.0-beta-26f2496093-20240514
npm ERR! node_modules/react
npm ERR!   react@"^19.0.0-beta-26f2496093-20240514" from the root project
npm ERR!   peer react@"19.0.0-beta-26f2496093-20240514" from react-dom@19.0.0-beta-26f2496093-20240514
npm ERR!   node_modules/react-dom
npm ERR!     react-dom@"^19.0.0-beta-26f2496093-20240514" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=16.8.0" from @emotion/react@11.11.4
npm ERR! node_modules/@emotion/react
npm ERR!   @emotion/react@"^11.11.4" from the root project
npm ERR!   peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.11.5
npm ERR!   node_modules/@emotion/styled
npm ERR!     @emotion/styled@"^11.11.5" from the root project
npm ERR!     3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR!   3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR! 
npm ERR! Conflicting peer dependency: react@18.3.1
npm ERR! node_modules/react
npm ERR!   peer react@">=16.8.0" from @emotion/react@11.11.4
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"^11.11.4" from the root project
npm ERR!     peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.11.5
npm ERR!     node_modules/@emotion/styled
npm ERR!       @emotion/styled@"^11.11.5" from the root project
npm ERR!       3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR!     3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

To reproduce:

  1. Upgrade React to v19
  2. npm i

Expected behavior: successful npm install

Environment information:

KavehKarami commented 6 days ago

I have the same issue

camiloguz23 commented 13 hours ago

los mismo tengo el mismo problema , usando next.js 15