nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.95k stars 3.52k forks source link

Next 14 is missing from allowed peer dependencies #8970

Closed beck24 closed 1 year ago

beck24 commented 1 year ago

Environment

System: OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa) CPU: (16) x64 AMD Ryzen 7 1700 Eight-Core Processor Memory: 5.91 GB / 11.69 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 19.8.1 - ~/.nodenv/versions/19.8.1/bin/node Yarn: 1.22.18 - /mnt/c/Program Files/nodejs/yarn npm: 8.19.2 - ~/labs-web/node_modules/.bin/npm

Reproduction URL

https://github.com/beck24/next-auth-example

Describe the issue

Next 14 was just released, attempted to upgrade but was blocked by next-auth

> npm install next-auth@latest

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: labs@0.1.0
npm ERR! Found: next@14.0.0
npm ERR! node_modules/next
npm ERR!   next@"^14.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.2.5 || ^13" from next-auth@4.24.3
npm ERR! node_modules/next-auth
npm ERR!   next-auth@"4.24.3" 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! 
npm ERR! For a full report see:
npm ERR! /<path/to/npm>/_logs/2023-10-26T22_31_51_789Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /<path/to/npm>/_logs/2023-10-26T22_31_51_789Z-debug-0.log

How to reproduce

Attempt to install next-auth into a Next 14 project

npm install next-auth

Expected behavior

next-auth should install and work with Next 14

piyanggoon commented 1 year ago

same issue here. . . .

resolve: just replace "next": "^12.2.5 || ^13 || ^14", line on package-lock.json

beck24 commented 1 year ago

same issue here. . . .

resolve: just replace "next": "^12.2.5 || ^13 || ^14", line on package-lock.json

Yeah I know it can be forced, but I'd rather not. It's nice to know someone on the project had checked it out and run tests with the version and that it's actually compatible. I expect it to be compatible as-is though based on the Next changelog.

balazsorban44 commented 1 year ago

It is, nothing has changed! I'll look into it when I'm close to a computer again. Feel free to ignore this warning for now.

Optionally give this a go! https://authjs.dev/guides/upgrade-to-v5

šŸ‘€

engislam95 commented 1 year ago

I have faced currently the same issue while setup next.js app using @latest 14 image

Gigioxx commented 1 year ago

I have the same issue, but running the application and running tests, nextauth works perfectly. I hope that NextAuth fixes this soon šŸŒŸ

balazsorban44 commented 1 year ago

4.24.4 is out with a fix. Please upgrade npm i next-auth@latest