Closed
Description
Checklist
- The issue can be reproduced in the nextjs-auth0 sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
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:
- Error: Route "/dashboard" used
cookies().getAll()
.cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis - Error: Route "/dashboard" used
cookies().set('appSession', ...)
.cookies()
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis - Error: Route "/api/auth/[auth0]" used
params.auth0
.params
should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
All 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)
29 | ...args: A
30 | ): ReturnType<F> {
> 31 | return fn.call(thisArg, ...args);
| ^
32 | }
33 |
34 | bind<T>(_context: types.Context, target: T): T {
Reproduction
- Use getSession()
- Run app with npm run dev
- Go to route and errors appear in console.
Additional context
No response
nextjs-auth0 version
3.5.0
Next.js version
15.0.2
Node.js version
22.8.0
Metadata
Metadata
Assignees
Labels
No labels