Credentials Adapter -> TypeError: Cannot read properties of undefined (reading 'get') #11971
Unanswered
gustavotrapp
asked this question in
Help
Replies: 0 comments
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.
-
Provider type
Credentials
Environment
System:
OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12450H
Memory: 3.29 GB / 15.33 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 20.17.0 - /usr/bin/node
npm: 10.8.2 - /usr/bin/npm
pnpm: 8.15.4 - ~/.local/share/pnpm/pnpm
bun: 1.1.7 - ~/.bun/bin/bun
Browsers:
Chrome: 129.0.6668.89
npmPackages:
@auth/prisma-adapter: ^1.0.9 => 1.6.0
next: ^14.1.0 => 14.2.14
next-auth: ^4.22.5 => 4.24.8
react: 18.2.0 => 18.2.0
Reproduction URL
I can't provide an example as this is happening at the company I work at so I can't share our github reporsitory link
Describe the issue
Context:
Hello, I am working on a NextJS project, migrating a old legacy system from PHP to NextJS.
For authentication and cookies management we use next-auth to help us move fast.
Breakdown:
Currently when running or NextJS locally or on the cloud after building it with the default NextJS build command, then running it with the default NextjJS startcommand.
When going to our sign in page in PHP and filling out the form correctly, we send the user to a NextJS route to sync both sessions.
When the NextJS page is ran, the console prints the error below (first image).
I've managed to pin point 2 places where a .get() method is called, (see the other two attached images)
The strangest part is, this only happens when building our application and running the application with the start command, NOT when running the application with the dev command.
Has anyone ever delt with this, or seen something similar.
Any help is appreciated as this is making us push forward the release date for our product.
Images:

Here is the first place I found with a .get() method

Here is the second place with a .get() method being called

^ This is called BEFORE first one
How to reproduce
I don't quite know how to reproduce this, all I can really do is help any of you that try to help me with some screenshots of some configs files.
Expected behavior
Not getting this error while running the credentials callback
Beta Was this translation helpful? Give feedback.
All reactions