TypeError: Cannot read properties of undefined (reading 'kindeAuth')

Hi - I've started getting this error on my production application. This is a new error when deployed to AWS using SST . I am using "@kinde-oss/kinde-auth-nextjs": "^2.4.6", When users click my login button I get a default Chrome error message Request URL: https://myURL.com/api/auth/login? 500 Internal Server Error I have not changed my application code: import { handleAuth } from "@kinde-oss/kinde-auth-nextjs/server"; export const GET = handleAuth(); Any ideas how to try and debug this?
3 Replies
David Bainbridge
Hi Ollie

Thank you for reaching out. This error typically indicates that the kindeAuth object is not properly initialized or accessible.
Can you confirm that the Node.js version running in your AWS environment is compatible with the @kinde-oss/kinde-auth-nextjs SDK ?
sassydinosaur
sassydinosaur2mo ago
I am getting the exact same error all of a sudden. Also deploying to AWS using SST. Did you figure it out @Ollie Mansell ?
David Bainbridge
Hi Ollie and sassydinosaur, We’re aware that some users are still encountering the “Cannot read properties of undefined (reading 'kindeAuth')” error when deploying on AWS using SST. Based on our initial analysis, this error typically points to one of two areas: 1. Please ensure your AWS environment is running a Node.js version that is compatible with our SDK. Our documentation recommends using Node.js 16.x (or later) for optimal compatibility. You can review the Kinde Developer Docs for guidance on environment setup. 2. This error can also occur if the kindeAuth object isn’t properly initialized, which might be due to missing or misconfigured environment variables in your production environment. Please verify that all required configuration values are correctly set in your AWS setup. As a temporary workaround, you might try: - Confirming the Node.js version in your AWS environment and, if necessary, downgrading/upgrading to a supported version. - Double-checking your environment variable settings to ensure nothing is missing. For further reference, a similar discussion has been tracked in our GitHub issues—please see Issue #278 for context on related type issues and potential workarounds (while Issue #278 primarily addresses type errors, some users have reported related initialization issues). If these steps don’t resolve the issue, please let me know, and I’ll escalate this to our engineering team for further investigation.
GitHub
chore(deps): update dependency vitest to ^2.1.6 [security] - autocl...
This PR contains the following updates: Package Change Age Adoption Passing Confidence vitest (source) ^3.0.5 -> ^2.1.6 GitHub Vulnerability Alerts CVE-2025-24964 Summary Arbit...

Did you find this page helpful?