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

Usage with next 15 - params should be awaited before using its properties #85

Open
Vahor opened this issue Oct 28, 2024 · 1 comment
Open

Comments

@Vahor
Copy link

Vahor commented Oct 28, 2024

What version of this package are you using?
2.6.2

What happened?

In NextJS 15: https://nextjs.org/blog/next-15#async-request-apis-breaking-change
params should be awaited.

and currently that's not the case:

const detectedLang = props.params?.lang ?? props.searchParams?.lang

What did you expect to happen?

params should be awaited. https://nextjs.org/docs/app/building-your-application/upgrading/version-15#params--searchparams
example:

-    const detectedLang = props.params?.lang ?? props.searchParams?.lang
+   const params = await props.params;
+   const searchParams = await props.searchParams;
+   const detectedLang = params?.lang ?? searchParams?.lang

Note: This might not be the only issue with next 15 as applying this patch does no fix all my issues.

  • TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.useContext) is not a function

Are you willing to submit a pull request to fix this bug?
yes

@aralroca
Copy link
Owner

Feel free to PR 👌😊

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