Next15 cookies async #1604
olli-suoniemi
started this conversation in
General
Replies: 1 comment
-
check this
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Just in case someone is following the example from here AND using NextJS 15, the setting/getting of the cookies won't work
In Next.JS 15, the cookies is an async function. Check example from documentation
I was doing
await cookies().set(COOKIE_NAME, locale);
and wondering why it doesn't work, but the correct syntax is:
(await cookies()).set(COOKIE_NAME, locale);
Beta Was this translation helpful? Give feedback.
All reactions