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
In NextJS v15 the way a route is determined to be static or not is by awaiting either a header or params... (I originally thought it was just if the function was async) I ran into an issue where I had a page component getting kinde user and this was moved to another file because i'm using the kinde id as the id in my db except for the kp_ part of the string
When deployed (not in dev mode) I would get the error to many redirects. the issue I found was that it was redirecting me to sign in from the function getKindeUser (as opposed to the middleware). This was because during the build I believe this expression was evaluated and user was null thus returning the redirect. when I looked at the build logs it said the pages using this function were static the only ones that were not static that were using this function were dynamic routes. I believe a fix can be to make getKindeServerSession an async function and just call await headers() to force it not to be evaluated at build.
Prerequisites
Describe the issue
"@kinde-oss/kinde-auth-nextjs": "^2.4.6",
"next": "15.1.6",
In NextJS v15 the way a route is determined to be static or not is by awaiting either a header or params... (I originally thought it was just if the function was async) I ran into an issue where I had a page component getting kinde user and this was moved to another file because i'm using the kinde id as the id in my db except for the kp_ part of the string
When deployed (not in dev mode) I would get the error to many redirects. the issue I found was that it was redirecting me to sign in from the function
getKindeUser
(as opposed to the middleware). This was because during the build I believe this expression was evaluated and user was null thus returning the redirect. when I looked at the build logs it said the pages using this function were static the only ones that were not static that were using this function were dynamic routes. I believe a fix can be to makegetKindeServerSession
an async function and just callawait headers()
to force it not to be evaluated at build.Library URL
https://github.com/kinde-oss/kinde-auth-nextjs
Library version
2.4.6
Operating system(s)
macOS
Operating system version(s)
macOS sequoia Version 15.1.1
Further environment details
No response
Reproducible test case URL
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: