#Prisma Adapter error with Auth Js.

3 messages · Page 1 of 1 (latest)

gilded belfry
#

Hey guys just wondering what is causing this error in my application. I have everything working correctly with the schema populating the databse with the correct tables, its just whenever i have that code on line 12 i get this error. Any help on this would be appreciated, Thanks.

vestal lion
gilded belfry
#

hey nurul thank you for this, in the thread the guy seems to be using mongodb schema and resolves the issue that way. However I am using the schema found here from the docs https://authjs.dev/reference/adapter/prisma. datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL") // Only needed when using a cloud provider that doesn't support the creation of new databases, like Heroku. Learn more: https://pris.ly/d/migrate-shadow
}

generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialActions"] // You won't need this in Prisma 3.X or higher.
}

model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?

user User @relation(fields: [userId], references: [id], onDelete: Cascade)

@@unique([provider, providerAccountId])
}

model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
}

model VerificationToken {
identifier String
token String @unique
expires DateTime

@@unique([identifier, token])
} still not sure what might be causing this.

Prisma

About the shadow database