staylor / react-helmet-async

Thread-safe Helmet for React 16+ and friends
Apache License 2.0
2.11k stars 154 forks source link

Support for react-dom ^17 #120

Closed basvandriel closed 3 years ago

basvandriel commented 3 years ago

After closing #119 the error below still occurs when trying to install this on a React 17 app.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: project@0.1.0
npm ERR! Found: react-dom@17.0.1
npm ERR! node_modules/react-dom
npm ERR!   react-dom@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-dom@"^16.6.0" from react-helmet-async@1.0.8
npm ERR! node_modules/react-helmet-async
npm ERR!   react-helmet-async@"*" 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!
npm ERR! See /home/bas/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bas/.npm/_logs/2021-03-03T08_55_32_962Z-debug.log

Also, when using --force when installing the package, the peer dependencies are listed as below:

  "peerDependencies": {
    "react": "^16.6.0 || ^17",
    "react-dom": "^16.6.0"
  },
romiem commented 3 years ago

Could it be that the react and react-dom peerDependencies in the package.json for this project are defined as "^17.0.0-0"?

Would changing them both to "^17.0.0" (without the "-0" suffix) resolve this issue?

basvandriel commented 3 years ago

The error doesn't appear anymore on the react package. That's why I only changed it for react-dom. Hope to get this closed soon!

staylor commented 3 years ago

I am going to push a version that removes the -0s from them

staylor commented 3 years ago

Try this: https://www.npmjs.com/package/react-helmet-async/v/1.0.9

romiem commented 3 years ago

That's done the job - thanks so much Scott!