question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When building project, there is a lot of errors from node_modules/.prisma/client/index.d.ts

See original GitHub issue

Bug description

When building project, there is a lot of errors from node_modules/.prisma/client/index.d.ts in console. I’ve updated Prisma, Typescript, Node, NPM to latest version, like here said. But that’s not changing.

That’s errors:

node_modules/.prisma/client/index.d.ts:504:8 - error TS2300: Duplicate identifier
'CheckSelect'.

504   type CheckSelect<T, S, U> = T extends SelectAndInclude
           ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:1485:15 - error TS2300: Duplicate identifie
r 'CheckSelect'.

1485   export type CheckSelect = {
                   ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:1915:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

1915     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:1942:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

1942     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2004:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2004     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2055:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2055     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2086:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2086     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2122:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2122     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2154:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2154     select?: CheckSelect | null
                  ~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2184:14 - error TS2314: Generic type 'Check
Select' requires 3 type argument(s).

2184     select?: CheckSelect | null
                  ~~~~~~~~~~~

Expected behavior

Not having errors

Prisma information

datasource db {
  provider = "postgresql"
  url      = ""
}

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

model Check {
  id           Int            @id @default(autoincrement())
  uid          String         @db.VarChar(255)
  status       CheckStatus
  discount     Decimal
  extra_charge Decimal
  cashier      Cashier        @relation(fields: [cashierId], references: [id])
  cashierId    Int
  Payment      Payment[]
  CheckDetails CheckDetails[]
}

enum CheckStatus {
  Processing
  Done
  Error
}

model Payment {
  id            Int         @id @default(autoincrement())
  check         Check       @relation(fields: [checkId], references: [id])
  checkId       Int
  sum           Decimal
  provided      Decimal
  remains       Decimal
  type          PaymentType @relation(fields: [paymentTypeId], references: [id])
  paymentTypeId Int
}

model PaymentType {
  id      Int       @id @default(autoincrement())
  name    String    @db.VarChar(255)
  Payment Payment[]
}

model CheckDetails {
  id           Int     @id @default(autoincrement())
  product_name String  @db.VarChar(255)
  discount     Decimal
  extra_charge Decimal
  check        Check   @relation(fields: [checkId], references: [id])
  checkId      Int
  unit         Unit    @relation(fields: [unitId], references: [id])
  unitId       Int
}

model Unit {
  id           Int            @id @default(autoincrement())
  code         String         @db.VarChar(255)
  name         String         @db.VarChar(255)
  CheckDetails CheckDetails[]
}

model Shift {
  id              Int      @id @default(autoincrement())
  uid             String   @db.VarChar(255)
  datetime_opened DateTime
  datetime_closed DateTime
  cashier         Cashier  @relation(fields: [cashierId], references: [id])
  cashierId       Int
}

model OfflineSession {
  id              Int      @id @default(autoincrement())
  uid             String   @db.VarChar(255)
  datetime_opened DateTime
  datetime_closed DateTime
  cashier         Cashier  @relation(fields: [cashierId], references: [id])
  cashierId       Int
  offlineSesionId String   @db.VarChar(128)
  offlineSeed     String   @db.VarChar(128)
}

model Cashier {
  id              Int     @id @default(autoincrement())
  object          Object  @relation(fields: [objectId], references: [id])
  objectId        Int
  register_number String  @db.VarChar(255)
  desk_number     String  @db.VarChar(255)
  Check           Check[]
  Shift           Shift[]
}

model Object {
  id             Int          @id @default(autoincrement())
  name           String       @db.VarChar(255)
  adress         String       @db.VarChar(255)
  organization   Organization @relation(fields: [organizationId], references: [id])
  organizationId Int
  cashiers       Cashier[]
}

model Organization {
  id      Int      @id @default(autoincrement())
  name    String   @db.VarChar(255)
  objects Object[]
}

model Sellers {
  id        Int    @id @default(autoincrement())
  full_name String @db.VarChar(255)
  IPN       String @db.VarChar(255)
  TIN       String @db.VarChar(255)
  cert      Bytes
}

model Z_report {
  id        Int    @id @default(autoincrement())
  full_name String @db.VarChar(255)
  IPN       String @db.VarChar(255)
  TIN       String @db.VarChar(255)
  cert      Bytes
}

Environment & setup

  • OS: Windows
  • Database: PostgreSQL
  • Node.js version: v16.5.0

Prisma Version

3.6.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arthurlomakin12345commented, Dec 14, 2021

Sorry for that. But it worked)) Thank you

0reactions
arthurlomakin11commented, Jan 12, 2022

I still have a lot of errors. Github failed when I tried to paste them all, so this is the small part. There are 488!!

node_modules/.prisma/client/index.d.ts:11:33 - error TS1110: Type expected.

11   [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
                                   ~~~

node_modules/.prisma/client/index.d.ts:11:56 - error TS1005: ':' expected.

11   [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
                                                          ~~~~~~~

node_modules/.prisma/client/index.d.ts:11:87 - error TS1005: '(' expected.

11   [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
                                                                                         ~

node_modules/.prisma/client/index.d.ts:11:91 - error TS1005: ',' expected.

11   [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
                                                                                             ~

node_modules/.prisma/client/index.d.ts:11:117 - error TS1005: '(' expected.

11   [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise<infer X> ? X : UnwrapPromise<Tuple[K]> : UnwrapPromise<Tuple[K]>
                                                                                                                       ~

node_modules/.prisma/client/index.d.ts:12:1 - error TS1005: '(' expected.

12 };
   ~

node_modules/.prisma/client/index.d.ts:12:2 - error TS1005: ')' expected.

12 };
    ~

node_modules/.prisma/client/index.d.ts:995:60 - error TS1110: Type expected.

995   type ExcludeUnderscoreKeys<T extends string> = T extends `_${string}` ? never : T
                                                               ~~~~

node_modules/.prisma/client/index.d.ts:2115:15 - error TS1110: Type expected.

2115             ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
                   ~~~~~~~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:2116:13 - error TS1128: Declaration or statement expected.

2116             : [
                 ~

node_modules/.prisma/client/index.d.ts:2123:7 - error TS1128: Declaration or statement expected.

2123       : 'take' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:2123:16 - error TS1005: ';' expected.

2123       : 'take' extends Keys<T>
                    ~~~~~~~

node_modules/.prisma/client/index.d.ts:2124:7 - error TS1005: '(' expected.

2124       ? 'orderBy' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:2124:19 - error TS1005: ',' expected.

2124       ? 'orderBy' extends Keys<T>
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:2125:9 - error TS1005: '(' expected.

2125         ? ByValid extends True
             ~

node_modules/.prisma/client/index.d.ts:2125:19 - error TS1005: ',' expected.

2125         ? ByValid extends True
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:2128:37 - error TS1005: ',' expected.

2128               [P in OrderFields]: P extends ByFields
                                         ~~~~~~~

node_modules/.prisma/client/index.d.ts:2128:45 - error TS1005: ':' expected.

2128               [P in OrderFields]: P extends ByFields
                                                 ~~~~~~~~

node_modules/.prisma/client/index.d.ts:2132:9 - error TS1005: ',' expected.

2132         : 'Error: If you provide "take", you also need to provide "orderBy"'
             ~

node_modules/.prisma/client/index.d.ts:2133:7 - error TS1005: ',' expected.

2133       : 'skip' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:2133:16 - error TS1005: ',' expected.

2133       : 'skip' extends Keys<T>
                    ~~~~~~~

node_modules/.prisma/client/index.d.ts:2134:7 - error TS1005: '(' expected.

2134       ? 'orderBy' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:2134:19 - error TS1005: ',' expected.

2134       ? 'orderBy' extends Keys<T>
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:2135:9 - error TS1005: '(' expected.

2135         ? ByValid extends True
             ~

node_modules/.prisma/client/index.d.ts:2135:19 - error TS1005: ',' expected.

2135         ? ByValid extends True
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:2138:37 - error TS1005: ',' expected.

2138               [P in OrderFields]: P extends ByFields
                                         ~~~~~~~

node_modules/.prisma/client/index.d.ts:2138:45 - error TS1005: ':' expected.

2138               [P in OrderFields]: P extends ByFields
                                                 ~~~~~~~~

node_modules/.prisma/client/index.d.ts:2142:9 - error TS1005: ',' expected.

2142         : 'Error: If you provide "skip", you also need to provide "orderBy"'
             ~

node_modules/.prisma/client/index.d.ts:2143:7 - error TS1005: ',' expected.

2143       : ByValid extends True
           ~

node_modules/.prisma/client/index.d.ts:2143:17 - error TS1005: ',' expected.

2143       : ByValid extends True
                     ~~~~~~~

node_modules/.prisma/client/index.d.ts:2146:33 - error TS1005: ',' expected.

2146           [P in OrderFields]: P extends ByFields
                                     ~~~~~~~

node_modules/.prisma/client/index.d.ts:2146:41 - error TS1005: ':' expected.

2146           [P in OrderFields]: P extends ByFields
                                             ~~~~~~~~

node_modules/.prisma/client/index.d.ts:2150:11 - error TS1005: ')' expected.

2150     >(args: SubsetIntersection<T, ReceiptGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetReceiptGroupByPayload<T> : Promise<InputErrors>
               ~

node_modules/.prisma/client/index.d.ts:2150:67 - error TS1005: '(' expected.

2150     >(args: SubsetIntersection<T, ReceiptGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetReceiptGroupByPayload<T> : Promise<InputErrors>
                                                                       ~

node_modules/.prisma/client/index.d.ts:2150:81 - error TS1005: ',' expected.

2150     >(args: SubsetIntersection<T, ReceiptGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetReceiptGroupByPayload<T> : Promise<InputErrors>
                                                                                     ~

node_modules/.prisma/client/index.d.ts:2150:86 - error TS1005: ',' expected.

2150     >(args: SubsetIntersection<T, ReceiptGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetReceiptGroupByPayload<T> : Promise<InputErrors>
                                                                                          ~~~~~~~

node_modules/.prisma/client/index.d.ts:2150:136 - error TS1005: '(' expected.

2150     >(args: SubsetIntersection<T, ReceiptGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetReceiptGroupByPayload<T> : Promise<InputErrors>

                    ~

node_modules/.prisma/client/index.d.ts:2151:3 - error TS1005: '(' expected.

2151   }
       ~

node_modules/.prisma/client/index.d.ts:2159:3 - error TS1135: Argument expression expected.

2159   export class Prisma__ReceiptClient<T> implements PrismaPromise<T> {
       ~~~~~~

node_modules/.prisma/client/index.d.ts:3028:15 - error TS1110: Type expected.

3028             ? `Error: Field "${P}" used in "having" needs to be provided in "by".`
                   ~~~~~~~~~~~~~~~~~

node_modules/.prisma/client/index.d.ts:3029:13 - error TS1128: Declaration or statement expected.

3029             : [
                 ~

node_modules/.prisma/client/index.d.ts:3035:9 - error TS1128: Declaration or statement expected.

3035         }[HavingFields]
             ~

node_modules/.prisma/client/index.d.ts:3036:7 - error TS1128: Declaration or statement expected.

3036       : 'take' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:3036:16 - error TS1005: ';' expected.

3036       : 'take' extends Keys<T>
                    ~~~~~~~

node_modules/.prisma/client/index.d.ts:3037:7 - error TS1005: '(' expected.

3037       ? 'orderBy' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:3037:19 - error TS1005: ',' expected.

3037       ? 'orderBy' extends Keys<T>
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:3038:9 - error TS1005: '(' expected.

3038         ? ByValid extends True
             ~

node_modules/.prisma/client/index.d.ts:3038:19 - error TS1005: ',' expected.

3038         ? ByValid extends True
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:3041:37 - error TS1005: ',' expected.

3041               [P in OrderFields]: P extends ByFields
                                         ~~~~~~~

node_modules/.prisma/client/index.d.ts:3041:45 - error TS1005: ':' expected.

3041               [P in OrderFields]: P extends ByFields
                                                 ~~~~~~~~

node_modules/.prisma/client/index.d.ts:3045:9 - error TS1005: ',' expected.

3045         : 'Error: If you provide "take", you also need to provide "orderBy"'
             ~

node_modules/.prisma/client/index.d.ts:3046:7 - error TS1005: ',' expected.

3046       : 'skip' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:3046:16 - error TS1005: ',' expected.

3046       : 'skip' extends Keys<T>
                    ~~~~~~~

node_modules/.prisma/client/index.d.ts:3047:7 - error TS1005: '(' expected.

3047       ? 'orderBy' extends Keys<T>
           ~

node_modules/.prisma/client/index.d.ts:3047:19 - error TS1005: ',' expected.

3047       ? 'orderBy' extends Keys<T>
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:3048:9 - error TS1005: '(' expected.

3048         ? ByValid extends True
             ~

node_modules/.prisma/client/index.d.ts:3048:19 - error TS1005: ',' expected.

3048         ? ByValid extends True
                       ~~~~~~~

node_modules/.prisma/client/index.d.ts:3051:37 - error TS1005: ',' expected.

3051               [P in OrderFields]: P extends ByFields
                                         ~~~~~~~

node_modules/.prisma/client/index.d.ts:3051:45 - error TS1005: ':' expected.

3051               [P in OrderFields]: P extends ByFields
                                                 ~~~~~~~~

node_modules/.prisma/client/index.d.ts:3055:9 - error TS1005: ',' expected.

3055         : 'Error: If you provide "skip", you also need to provide "orderBy"'
             ~

node_modules/.prisma/client/index.d.ts:3056:7 - error TS1005: ',' expected.

3056       : ByValid extends True
           ~

node_modules/.prisma/client/index.d.ts:3056:17 - error TS1005: ',' expected.

3056       : ByValid extends True
                     ~~~~~~~

node_modules/.prisma/client/index.d.ts:3059:33 - error TS1005: ',' expected.

3059           [P in OrderFields]: P extends ByFields
                                     ~~~~~~~

node_modules/.prisma/client/index.d.ts:3059:41 - error TS1005: ':' expected.

3059           [P in OrderFields]: P extends ByFields
                                             ~~~~~~~~

node_modules/.prisma/client/index.d.ts:3063:11 - error TS1005: ')' expected.

3063     >(args: SubsetIntersection<T, PaymentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentGroupByPayload<T> : Promise<InputErrors>
               ~

node_modules/.prisma/client/index.d.ts:3063:67 - error TS1005: '(' expected.

3063     >(args: SubsetIntersection<T, PaymentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentGroupByPayload<T> : Promise<InputErrors>
                                                                       ~

node_modules/.prisma/client/index.d.ts:3063:81 - error TS1005: ',' expected.

3063     >(args: SubsetIntersection<T, PaymentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentGroupByPayload<T> : Promise<InputErrors>
                                                                                     ~

node_modules/.prisma/client/index.d.ts:3063:86 - error TS1005: ',' expected.

3063     >(args: SubsetIntersection<T, PaymentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentGroupByPayload<T> : Promise<InputErrors>
                                                                                          ~~~~~~~

node_modules/.prisma/client/index.d.ts:3063:136 - error TS1005: '(' expected.

3063     >(args: SubsetIntersection<T, PaymentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPaymentGroupByPayload<T> : Promise<InputErrors>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma Client
Prisma Client is an auto-generated, type-safe query builder generated based on the models and attributes of your Prisma schema.
Read more >
How do I prevent VS 2022 to display typescript errors with ...
It build well but visual studio is showing a lot of errors (only on .dt.ts files from node_modules of the project and also...
Read more >
Command Line Interface | RedwoodJS Docs
See Builds. Example. Running yarn redwood build without any arguments generates the Prisma client and builds both sides of your project:.
Read more >
How To Build a REST API with Prisma and PostgreSQL
Prisma is an open-source ORM for Node.js and TypeScript. It consists of three main tools: Prisma Client: An auto-generated and type-safe query ...
Read more >
What does it take to support Node.js ESM?
To add support ESM for Node.js, you have two alternatives: build your library into ESM Compatible modules with the extension .mjs , and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found