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

Error: Route "/api/auth/[auth0]" used params.auth0. params should be awaited before using its properties. #175

Open
4 tasks done
akladyous opened this issue Oct 27, 2024 · 1 comment

Comments

@akladyous
Copy link

Checklist

  • I have looked into the Readme 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

This issue arises from a breaking change introduced in Next.js 15, which transitioned certain APIs to be asynchronous. according to Next.js release notes:

the server now requires awaiting request-specific data (such as params, headers, cookies, and searchParams) before using their properties.

Reproduction

`import { handleAuth } from "@auth0/nextjs-auth0";

export const GET = handleAuth();
`

Additional context

Screenshot 2024-10-27 at 11 31 46 AM

@portal7
Copy link

portal7 commented Nov 16, 2024

If you are running NextJS 15, you can see what the documentation says to solve this problem (see the image)

TL,DR: You have to run this (I strongly recommend to take the time to read the documentation first, as not all cases are compatible, but fortunately for me, this solved the problem)
$ npx @next/codemod@canary next-async-request-api .

image

image

After commit my current changes.

image

And finally

image

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

No branches or pull requests

2 participants