Hey! I have a really weird issue. After running p...
# orm-help
f
Hey! I have a really weird issue. After running prisma generate with NestJS. I am getting this error.
Copy code
backend-v2 on ī‚  master [!+?] is šŸ“¦ v0.0.1 via ⬢ v15.0.1 took 12s 
āžœ prisma generate
Environment variables loaded from prisma/.env
Error: 
TypeError: Cannot read property 'filter' of undefined
    at getMappings (/Users/franciszekstodulski/develop/chillout/backend-v2/node_modules/@prisma/client/generator-build/index.js:76364:52)
r
@Franciszek Stodulski šŸ‘‹ Could you share your Prisma version and
schema.prisma
?
f
Copy code
generator client {
  provider = "prisma-client-js"
  output = "generated/client"
}

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

model RootAdmin {
  id        Int      @id @default(autoincrement())
  createdAt DateTime @default(now())
  updatedAt DateTime @default(now())
  email     String   @unique
  fullName  String
  password  String
}

model City {
  id         Int          @id @default(autoincrement())
  createdAt  DateTime     @default(now())
  updatedAt  DateTime     @default(now())
  name       String       @unique
  Attraction Attraction[]
}

model Image {
  id           Int        @id @default(autoincrement())
  path         String     @unique
  attractionId Int
  attraction   Attraction @relation(fields: [attractionId], references: [id])

  @@index([attractionId], name: "attractionId")
}

model Admin {
  id          Int         @id @default(autoincrement())
  createdAt   DateTime    @default(now())
  updatedAt   DateTime    @default(now())
  email       String      @unique
  password    String
  attractions Attraction[]
}

model Attraction {
  id              Int     @id @default(autoincrement())
  ownerId         Int     @unique
  name            String
  phoneNumber     Int     @unique
  streetName      String
  postCode        Int
  backgroundImage String
  avatarImage     String
  cityId          Int
  description     String
  city            City    @relation(fields: [cityId], references: [id])
  owner           Admin   @relation(fields: [ownerId], references: [id])
  gallery         Image[]

  @@index([cityId], name: "cityId")
}
@prisma/cli : 2.6.2
Copy code
"@prisma/client": "^2.11.0"
@Ryan ā˜ļø
r
Could you update your CLI to be in sync with the client and check? That might be causing the issue.
f
@Ryan Updated CLI. Getting this issue with NestJs @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390. +23ms
r
Did you run
prisma generate
after updating?
f
Yes. Generated
r
Strange. I would suggest opening an issue here.