kinde-oss / kinde-auth-nextjs

Kinde NextJS SDK - authentication for server rendered apps
https://kinde.com/docs/developer-tools/nextjs-sdk/
MIT License
134 stars 17 forks source link

Bug: (getKindeServerSession throws an error in generateStaticParams) #92

Closed princemuel closed 8 months ago

princemuel commented 8 months ago

Prerequisites

Describe the issue

When using the getUser function from getKindeServerSession to get the user id in generateStaticParams (Nextjs 14.0.2 App Router) inside nested page route (/posts/[slug]), it throws this error... (Error: Invariant: cookies() expects to have requestAsyncStorage, none available)

Library URL

https://github.com/kinde-oss/kinde-auth-nextjs

Library version

1.8.25

Operating system(s)

Ubuntu

Operating system version(s)

22.04

Further environment details

Node v20 Firefox v118

Reproducible test case URL

No response

Additional information

princemuel commented 8 months ago

Oh, its fixed in version 2