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

Doesn't work with React.js 17 #42

Open
gadget2015 opened this issue Feb 9, 2022 · 2 comments
Open

Doesn't work with React.js 17 #42

gadget2015 opened this issue Feb 9, 2022 · 2 comments

Comments

@gadget2015
Copy link

I am using CRA 5.0.0, and try to install this npm-module. Then I got this error message:

PS C:\temp\temp\helloworld> npm install react-web-component
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.2.0" from [email protected]
npm ERR! node_modules/react-web-component
npm ERR! react-web-component@"*" 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.
npm ERR!

@dperish
Copy link

dperish commented Sep 23, 2022

Same issue with react 18.2. Is this a dead project?

@fabian-parra
Copy link

fabian-parra commented Feb 15, 2023

The library have peerDependency for react 16.2.0, so you need use the same version.

I try to force with npm install --force react-web-component and still work with react 17.0.2 because the only dependency affected is ReactDom.render and React.cloneElement, but if you use react 18 maybe don't work because the render method is replaced by createRoot (https://beta.reactjs.org/reference/react-dom/render)

Is something :)

EDIT: --legacy-peer-deps option also is an alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants