-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@auth/prisma-adapter
: createUser
causes TS errors (skew between "@auth/core/adapters" and "next-auth/adapters"?)
#7727
Comments
@auth/prisma-adapter
: createUser
causes TS errors (not allowing an undefined
response)@auth/prisma-adapter
: createUser
causes TS errors (skew between "@auth/core/adapters" and "next-auth/adapters"?)
This is currently expected. This is true for all adapters. If you are on |
is there a workaround for this? |
I just installed |
The documentation is not updated to solve this error: https://authjs.dev/reference/adapter/prisma Can anybody do this? I am new to open source. |
EDIT : The error was on my part but the error made no sense so it was really hard to debug. I thought it was an error coming from the adapter config For some reason, I imported Logger from "next-auth/src/utils/logger" (which makes no sense), removing this line fixed the issue. I'm leaving this comment if this can help someone someday :') I tried to fix the issue by using the
My
package.json :
|
I have the same compile problem as @Oryss but without any adapter provided in my NextAuthOptions ...
|
@Oryss @fdrouet To resolve the problem, change the array into "as const" so that the array will be read-only // node_module>next-auth>src>core>lib>assert.ts
const missingMethods = ([
"createVerificationToken",
"useVerificationToken",
"getUserByEmail",
] as const).filter((method) => !adapter[method]) |
The workaround seems to work with
|
This seems to work
|
Unrelated note: |
Maybe this will solve, it worked for me: take it:
leave it like this::
|
This solved the issue for me, thanks |
Adapter type
@auth/prisma-adapter
Environment
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Max
Memory: 37.45 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.2.0 - /opt/homebrew/bin/node
npm: 9.6.6 - /opt/homebrew/bin/npm
Browsers:
Chrome: 114.0.5735.90
Safari: 16.5
Describe the issue
The following produces a TypeScript error:
The error:
"@auth/core/adapters"
When I rewrite the entire function but import types { Adapter, AdapterAccount } from
"next-auth/adapters"
, it works without complaining.How to reproduce
Nothing special with my stock prisma schema:
Expected behavior
No TS errors
The text was updated successfully, but these errors were encountered: