Next.js 14.0.3 Middleware TypeError
Subject: Assistance Needed with TypeScript Error in Kind Auth Implementation
Hey there! π
I hope this message finds you well. I'm currently using Kind Auth for the first time, and I've encountered a TypeScript error while trying to access a protected route.
Following the Next.js starter kit, I've set up the protected route at
/dashboard
. However, every time I attempt to access it, I'm confronted with the following error:
Server Error
TypeError: Cannot read properties of undefined (reading 'value')
Interestingly, despite this error, the authentication seems to be working fine. The user exists and is successfully populated in the database.
I'd greatly appreciate any guidance or assistance you can provide in resolving this issue.
Thanks a bunch! π
Github Repo: https://github.com/ruymon/revivi/tree/5ced50b82d94c4c329fde3709701746cf6ea2355GitHub
GitHub - ruymon/revivi at 5ced50b82d94c4c329fde3709701746cf6ea2355
revivi. Contribute to ruymon/revivi development by creating an account on GitHub.
11 Replies
Hi @Ruyy,
Thanks for flagging that your issue here is a duplicate of https://discord.com/channels/1070212618549219328/1179721063450546206
I can see in your repo that you are using the Kinde NextJS SDK v2.0.10
As mentioned in https://discord.com/channels/1070212618549219328/1179721063450546206, our NextJS expert teammate is looking into this issue. I will get back to you once we have more information.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Thanks!
Hey @Ruyy,
As mentioned in https://discord.com/channels/1070212618549219328/1179721063450546206/1179721063450546206, you should be able to use the middleware in NextJS App Router v1 to achieve what you are after: https://kinde.com/docs/developer-tools/nextjs-sdkv1/#protecting-pages
Please let me know if you come across any other issues.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Kinde Docs
NextJS App Router SDK v1 - Developer tools - Help center
Our developer tools provide everything you need to get started with Kinde.
Noted.
Hey @Ruyy,
As mentioned in https://discord.com/channels/1070212618549219328/1179721063450546206, there is a new version of the NextJS SDK v2.0.11 that fixed this middleware issue.
Please let us know if you are still experiencing any issues.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Hey, @Oli - Kinde !
I confess that I had changed the auth in that project cuz I was not sure how long till the issue was fixed but you guys are blazing fast π
We work at lightning speed here β‘ , we don't let issues like this get dust on them.