Prisma MongoDB

Hello everyone. I want to using Prisma with MongoDB, NestJS. I was setup with docs, and when start server, I have an error with Typescript:
yarn start
[9:51:57 AM] Starting compilation in watch mode...

node_modules/@prisma/client/runtime/library.d.ts:1444:35 - error TS1005: '?' expected.

1444 select: infer S extends object;
~

node_modules/@prisma/client/runtime/library.d.ts:1446:36 - error TS1005: '?' expected.

1446 include: infer I extends object;
~

[9:52:02 AM] Found 2 errors. Watching for file changes
yarn start
[9:51:57 AM] Starting compilation in watch mode...

node_modules/@prisma/client/runtime/library.d.ts:1444:35 - error TS1005: '?' expected.

1444 select: infer S extends object;
~

node_modules/@prisma/client/runtime/library.d.ts:1446:36 - error TS1005: '?' expected.

1446 include: infer I extends object;
~

[9:52:02 AM] Found 2 errors. Watching for file changes
this is my version of prisma: "prisma": "6.2.1", "@prisma/client": "6.2.1", And my mongoDB is local MongoDB, not replicate. But I not using transaction on my code This is my schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

model Document {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
description String?
code String @unique
fileUrl String?
partnerUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@map("Document")
}
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}

model Document {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
description String?
code String @unique
fileUrl String?
partnerUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@map("Document")
}
4 Replies
Prisma AI Help
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
RaphaelEtim
RaphaelEtim5d ago
Hi @Nguyễn Văn Vỹ What's your version of Typescript?
Nguyễn Văn Vỹ
Hi @RaphaelEtim . Thanks about your support. I was find an error issue, Because I am using Typescript 4.5.3. And it not compare with lastest Prisma After downgrade Prisma ( because this is old project and very hard to upgrade all package version). it work now. thanks :heart: A note for another pepople have this issue that you must using TS version > 5.0 to using Prisma version 5 and over
RaphaelEtim
RaphaelEtim5d ago
You're welcome.

Did you find this page helpful?