You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is incorrect information about the cookies function imported from next/headers returning a promise. From using it, I found that it actually returned a ReadonlyRequestCookies type and doesn't need to be awaited as most part of the cookies docs suggest.
Is there any context that might help us understand?
The cookies function returns a ReadOnlyRequestCookies type and not a promise hence it doesn't need to be awaited as suggested by the docs.
Does the docs page already exist? Please link to it.
In the section below - ‘good to know’ - it says the following:
Сookies is an asynchronous function that returns a promise. You must use async/await or React's use function to access cookies.
In version 14 and earlier, cookies was a synchronous function. To help with backwards compatability, you can still access it synchronously in Next.js 15, but this behavior will be deprecated in the future.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
What is the documentation issue?
There is incorrect information about the cookies function imported from
next/headers
returning a promise. From using it, I found that it actually returned aReadonlyRequestCookies
type and doesn't need to be awaited as most part of the cookies docs suggest.Is there any context that might help us understand?
The cookies function returns a
ReadOnlyRequestCookies
type and not a promise hence it doesn't need to be awaited as suggested by the docs.Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/api-reference/functions/cookies
The text was updated successfully, but these errors were encountered: