react-resize-aware icon indicating copy to clipboard operation
react-resize-aware copied to clipboard

peer dependency conflict with react 18.x

Open nickpell opened this issue 2 years ago • 1 comments

Unable to run npm install with react-size-aware and React 18.x.

% npm -v
8.13.1
% npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR!   peer react@">=16.8.0" from @emotion/[email protected]
npm ERR!   node_modules/@emotion/react
npm ERR!     peer @emotion/react@"^11.0.0-rc.0" from @emotion/[email protected]
npm ERR!     node_modules/@emotion/styled
npm ERR!       @emotion/styled@"^11.9.3" from the root project
npm ERR!       3 more (@mui/material, @mui/styled-engine, @mui/system)
npm ERR!     peerOptional @emotion/react@"^11.5.0" from @mui/[email protected]
npm ERR!     node_modules/@mui/material
npm ERR!       @mui/material@"^5.8.6" from the root project
npm ERR!     2 more (@mui/styled-engine, @mui/system)
npm ERR!   30 more (@emotion/styled, @mui/base, @mui/material, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || 17.x" from [email protected]
npm ERR! node_modules/react-resize-aware
npm ERR!   react-resize-aware@"^3.1.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^16.8.0 || 17.x" from [email protected]
npm ERR!   node_modules/react-resize-aware
npm ERR!     react-resize-aware@"^3.1.1" from the root project
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.

nickpell avatar Jun 27 '22 18:06 nickpell

Frankly I don't get why package authors keep placing limitation on the max supported version of React. That is their right of course, but I just do not get the logic behind it. It always frustrates me, when a great library just ceases to get the required maintenance on time, while having such a limitation in place. Any idea why?

kostia1st avatar Sep 05 '22 15:09 kostia1st

Issue was fixed in latest version, but from NPM it still installs the old version. You can install the latest version from github with npm install --save https://github.com/FezVrasta/react-resize-aware meanwhile.

constantin-barbu avatar Oct 26 '22 20:10 constantin-barbu

Published a new version with this fix.

FezVrasta avatar Oct 27 '22 14:10 FezVrasta