You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using next-auth (v4.24.11) with React 19 and Next.js 15, I'm encountering a runtime error related to React hooks. The error occurs when the SessionProvider component from next-auth attempts to use hooks with the newer React architecture.
Error Message
Added the session={null} prop to SessionProvider
Verified that all client components using hooks are properly marked with "use client"
Ensured proper configuration of next-auth
Additional Context
The issue seems to be related to the architectural changes in React 19. Downgrading to React 18.2.0 resolves the issue, but I'd like to understand if there are plans to support React 19 compatibility in an upcoming release of next-auth.
Questions
Is there a workaround to use next-auth with React 19 currently?
Is there a timeline for React 19 support in next-auth?
Thank you for your time and consideration!
How to reproduce
git clone "reproduction url provided"
cd "cloned directory"
npm i
npm run dev
Expected behavior
The expected behavior is that next-auth should work seamlessly with React 19 and Next.js 15 without producing runtime errors.
No console errors related to invalid hook calls or React internals should appear during normal operation.
Expect a library like next-auth to maintain compatibility with new major versions of React and Next.js either through timely updates or clear documentation about version constraints. If temporary incompatibility exists, clear error messages indicating version mismatch would be preferable to runtime errors.
The text was updated successfully, but these errors were encountered:
abhishekkumar35
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
Mar 10, 2025
Environment
Reproduction URL
https://github.com/abhishekkumar35/nextauth-react19-nextjs15-compatibility-issue
Describe the issue
Description
When using next-auth (v4.24.11) with React 19 and Next.js 15, I'm encountering a runtime error related to React hooks. The error occurs when the SessionProvider component from next-auth attempts to use hooks with the newer React architecture.
Error Message
Code Example
What I've Tried
Additional Context
The issue seems to be related to the architectural changes in React 19. Downgrading to React 18.2.0 resolves the issue, but I'd like to understand if there are plans to support React 19 compatibility in an upcoming release of next-auth.
Questions
Thank you for your time and consideration!
How to reproduce
git clone "reproduction url provided"
cd "cloned directory"
npm i
npm run dev
Expected behavior
The expected behavior is that next-auth should work seamlessly with React 19 and Next.js 15 without producing runtime errors.
No console errors related to invalid hook calls or React internals should appear during normal operation.
Expect a library like next-auth to maintain compatibility with new major versions of React and Next.js either through timely updates or clear documentation about version constraints. If temporary incompatibility exists, clear error messages indicating version mismatch would be preferable to runtime errors.
The text was updated successfully, but these errors were encountered: