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

Widen peer dependency range to include React 17 #814

Closed
billyjanitsch opened this issue Oct 31, 2020 · 7 comments · Fixed by #819
Closed

Widen peer dependency range to include React 17 #814

billyjanitsch opened this issue Oct 31, 2020 · 7 comments · Fixed by #819
Labels
enhancement New feature or request

Comments

@billyjanitsch
Copy link

Summary of proposed feature

React 17 was released recently with minimal breaking changes. next-auth currently supports only ^16.13.1:

next-auth/package.json

Lines 57 to 60 in 5126f4e

"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
},

Could this be widened to ^16.13.1 || ^17.0.0?

Purpose of proposed feature

Allows apps using React 17 to also use next-auth without peer dependency warnings.

Detail about proposed feature
n/a

Potential problems
There are subtle differences between React 16 and React 17, so it's worth reviewing to see if any of them might affect the library's functionality.

Describe any alternatives you've considered
You could alternatively release a new major version of next-auth that peer-depends only on React ^17.0.0, but since the changes are minimal, you may not want to deprecate support for React 16 going forward.

Additional context
n/a

Please indicate if you are willing and able to help implement the proposed feature.
Yes.

@billyjanitsch billyjanitsch added the enhancement New feature or request label Oct 31, 2020
@foaadnami
Copy link

+1

@skiabox
Copy link

skiabox commented Nov 6, 2020

Please check that issue, because NextJS is using React 17 now, so we can't use your library with NextJS any more!
Thank you!

@billyjanitsch
Copy link
Author

@skiabox that's not correct. You can use React 16 or React 17 with even the latest version of Next.js. See its peer dependencies. It's up to you which one you install.

@foaadnami
Copy link

next-auth doesnt seem to install out of the box on a clean node15/npm7/react17 setup and I wonder if its related to this issue
What am I missing and should this be added to the documentation ?

npm i next-auth
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myproject@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR! react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1" from next-auth@3.1.0
npm ERR! node_modules/next-auth
npm ERR! next-auth@"*" 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.

@billyjanitsch
Copy link
Author

@foaadnami the error is saying that there's a peer dependency conflict, because you've installed React 17 but next-auth currently requires React 16. You can fix it by using React 16 until next-auth expands its peer dependency range to include React 17, which is what this issue is about.

I don't think there's anything to be added to the documentation; this is the error that you'll get if you try to install any two incompatible packages.

@foaadnami
Copy link

@billyjanitsch I think what @skiabox means is that new installs of Next.Js via say npx create-next-app will default to react 17 which next-auth 3.1 will not install on top of

@github-actions
Copy link

github-actions bot commented Feb 1, 2021

🎉 This issue has been resolved in version 3.3.0-canary.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants