Open aresthegofwar opened 1 year ago
@kleydon any idea how to fix this
Hi @aresthegofwar, thanks for this.
I haven't encountered the error before, but if you post some context (ideally a PR on a fork of this repository, but possibly just a code snippet, showing how the error can be reproduced) it'll make it easier for anyone using this package to help with ideas for a solution.
By any chance are you using Nest or Passport? In the past, I believe other users have reported type mis-matches with these libraries; I'm not 100% sure if these have been solved yet or not.
Am using nestjs
And also passport too
@rajamoulimallareddy Just to clarify: You are using nest
and passport
with prisma-session-store
and seeing this issue? Or you are using nest
and passport
with prisma-session-store
successfully, and not seeing this issue?
(I've not used nest
or passport
, so related expertise is definitely appreciated here!)
Using nest and passport with prisma-session-store and am getting seeing this issue. And also even if it runs successfully the cookies are not generated for some reason
@rajamoulimallareddy Good to know; thanks for posting this context.
My time's pretty limited to work on this at the moment, but hopefully others who are using this library can jump in? Happy to review any PRs that can sort this out!
i'm using nestjs and prisma as well and seeing this issue, no passport. Nest is v9.3.9 and prisma v4.10 prisma-session-store is v3.1.10
@ChristopherLMiller - thanks for the additional data point.
@aresthegofwar looks like you haven't generated the client types or missing the session model. Try defining the Session model in your schema.prisma
if you haven't already:
model Session {
id String @id @default(auto()) @map("_id") @db.ObjectId
sid String @unique
data String
expiresAt DateTime
}
And then run npx prisma generate
.
@aresthegofwar looks like you haven't generated the client types or missing the session model. Try defining the Session model in your
schema.prisma
if you haven't already:model Session { id String @id @default(auto()) @map("_id") @db.ObjectId sid String @unique data String expiresAt DateTime }
And then run
npx prisma generate
.
Am not using mongoose and also I did generate the schema. It works fine when i login through login page.
I am also encountering this issue. Any fixes yet?
I am also encountering this issue. Any fixes yet?
just run npx prisma generate after when you have added model Session
Argument of type 'PrismaClient<PrismaClientOptions, never, RejectOnNotFound | RejectPerOperation>' is not assignable to parameter of type 'IPrisma<"session">'. Property 'session' is missing in type 'PrismaClient<PrismaClientOptions, never, RejectOnNotFound | RejectPerOperation>' but required in type 'Record<"session", { create(args: ICreateArgs): Promise<IPrismaSession>; delete(args: IDeleteArgs): Promise<IPrismaSession>; deleteMany(args?: unknown): Promise<...>; findMany(args?: IFindManyArgs): Promise<...>; findUnique(args: IFindUniqueArgs): Promise<...>; update(args: IUpdateArgs): Promise<...>; }>'.ts(2345)