Skip to content
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

session store error #111

Open
aresthegofwar opened this issue Mar 20, 2023 · 13 comments
Open

session store error #111

aresthegofwar opened this issue Mar 20, 2023 · 13 comments

Comments

@aresthegofwar
Copy link

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)

@aresthegofwar
Copy link
Author

@kleydon any idea how to fix this

@kleydon
Copy link
Owner

kleydon commented Mar 20, 2023

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.

@rajamoulimallareddy
Copy link

Am using nestjs

@rajamoulimallareddy
Copy link

And also passport too

@kleydon
Copy link
Owner

kleydon commented Mar 20, 2023

@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!)

@rajamoulimallareddy
Copy link

rajamoulimallareddy commented Mar 20, 2023

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

@kleydon
Copy link
Owner

kleydon commented Mar 20, 2023

@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!

@ChristopherLMiller
Copy link

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

@kleydon
Copy link
Owner

kleydon commented Mar 21, 2023

@ChristopherLMiller - thanks for the additional data point.

@junaidilyas
Copy link

@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.

@rajamoulimallareddy
Copy link

@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.

@zFlxw
Copy link

zFlxw commented Nov 15, 2023

I am also encountering this issue. Any fixes yet?

@SebaBoler
Copy link

I am also encountering this issue. Any fixes yet?

just run npx prisma generate after when you have added model Session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants