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 · 3 comments

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

@Primis1
Copy link

Primis1 commented Nov 23, 2024

Umm, i have read a docs about the issues. However in my case(as always) simple solution with npx command does not work. But i also CAN NOT access Auth0 - node code, which actually causes the issue. Like, ta hell i'm suppose to do, and why such issue even occurred in stable version of Next?

(No blames, i just feel how much time i gonna waste on that, to finally fix it)

@josephmarkus
Copy link

Same here. Can also confirm that the codemod didn't work since the issue is with auth0 code example

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

4 participants