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

Match react and @types/react versions in peer dependency list #1462

Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@hbendev
Copy link
Contributor

hbendev commented Jul 17, 2024

Expected Behavior

Versions of peer dependencies should match between react and @types/react.

Actual Behavior

"@types/react": "17 || 18",
"react": "0.14 || 15 || 16 || 17 || 18"

Steps to Reproduce

npm i [email protected] on a package with react@16 and @types/react@16

npm error Could not resolve dependency:
npm error peerOptional @types/react@"17 || 18" from [email protected]
npm error node_modules/html-react-parser
npm error   html-react-parser@"5.1.10" from the root project
npm error
npm error Conflicting peer dependency: @types/[email protected]
npm error node_modules/@types/react
npm error   peerOptional @types/react@"17 || 18" from [email protected]
npm error   node_modules/html-react-parser
npm error     html-react-parser@"5.1.10" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Reproducible Demo

Environment

  • Version:
  • Platform:
  • Browser:
  • OS:

Keywords

@hbendev hbendev added the bug Something isn't working label Jul 17, 2024
@remarkablemark
Copy link
Owner

@hbendev would you like to open a PR? I believe the fix would be to update this line:

-    "@types/react": "17 || 18",
+    "@types/react": "0.14 || 15 || 16 || 17 || 18",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment