Open sterno2510 opened 1 day ago
The same issue arises when using any of the other functions that use headers()
or cookies()
, such as getAccessToken
and similar.
This is due to the breaking changes that were implemented in NextJS 15.
I am guessing that this is a very important issue: it breaks the possibility to correctly authenticate server-side code.
A fix should be relatively simple using the specific codemod provided by NextJS
Many discussions have been made over at https://github.com/auth0/nextjs-auth0/issues/1779
TLDR; NextJS 15 IS NOT SUPPORTED until v4 is released.
V4 is effectively a rewrite and has many breaking changes, but is in beta. So id recommend using the beta if you want to use Next 15, or waiting for the official release whenever that happens
Checklist
Description
When using the getSession function imported from auth0/nextjs-auth0, I get a few errors in the console when the app compiles.
Specifically these 3:
cookies().getAll()
.cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apiscookies().set('appSession', ...)
.cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apisparams.auth0
.params
should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apisAll three errors appear to be coming from here:
at get (file:///Users/brianstern/code/ai-companion-next/node_modules/next/src/server/base-server.ts:3121:48)
Reproduction
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
15.0.2
Node.js version
22.8.0