prisma / studio

🎙️ The easiest way to explore and manipulate your data in all of your Prisma projects.
https://www.prisma.io/studio
1.87k stars 48 forks source link

Fatal error when loading prisma studio (ONLY SAFARI) #1238

Closed adammehdaoui closed 3 months ago

adammehdaoui commented 5 months ago

Bug description

I'm using the next auth model for prisma adapter and postgres database. My postgres database is running in container mode. When launching npx prisma studio I'm having a fatal error:

Fatal Error A non-recoverable error has occurred. Reload Studio to continue. Consider reporting this error to us by opening an issue on GitHub and attaching the error details.

How to reproduce

Run npx prisma migrate dev using this schema the linked schema.

Once the database is running, run npx prisma studio

Expected behavior

No response

Prisma information

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

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

model Account {
  id                 String    @id @default(cuid())
  userId             String
  providerType       String
  providerId         String
  providerAccountId  String
  refreshToken       String?
  accessToken        String?
  accessTokenExpires DateTime?
  createdAt          DateTime  @default(now())
  updatedAt          DateTime  @updatedAt
  user               User      @relation(fields: [userId], references: [id])

  @@unique([providerId, providerAccountId])
}

model Session {
  id           String   @id @default(cuid())
  userId       String
  expires      DateTime
  sessionToken String   @unique
  accessToken  String   @unique
  createdAt    DateTime @default(now())
  updatedAt    DateTime @updatedAt
  user         User     @relation(fields: [userId], references: [id])
}

model User {
  id            String    @id @default(cuid())
  name          String?
  email         String?   @unique
  emailVerified DateTime?
  image         String?
  createdAt     DateTime  @default(now())
  updatedAt     DateTime  @updatedAt
  accounts      Account[]
  sessions      Session[]
}

model VerificationRequest {
  id         String   @id @default(cuid())
  identifier String
  token      String   @unique
  expires    DateTime
  createdAt  DateTime @default(now())
  updatedAt  DateTime @updatedAt

  @@unique([identifier, token])
}

model Comment {
  id        Int       @id @default(autoincrement())
  content   String
  createdAt DateTime  @default(now())
  updatedAt DateTime? @updatedAt
  nftId     Int
  minterId  Int
  Minter    Minter    @relation(fields: [minterId], references: [id])
  Nft       Nft       @relation(fields: [nftId], references: [id])
  Report    Report[]
}

model Hashtag {
  id        Int      @id @default(autoincrement())
  name      String   @unique
  createdAt DateTime @default(now())
  nfts      Nft[]
}

model Minter {
  id                  Int               @id @default(autoincrement())
  username            String            @unique
  email               String            @unique
  password            String
  phoneNumber         String?
  defaultLanguage     String            @default("fr")
  profileUrl          String
  avatarUrl           String
  bio                 String
  location            String?
  authorName          String?
  isVisible           Boolean           @default(true)
  isSearchableByEmail Boolean           @default(true)
  is2FAEnabled        Boolean           @default(false)
  isAdmin             Boolean           @default(false)
  createdAt           DateTime          @default(now())
  updatedAt           DateTime?         @updatedAt
  deletedAt           DateTime?
  Comment             Comment[]
  OriginalContent     OriginalContent[]
  Report              Report[]
}

model Nft {
  id                Int             @id @default(autoincrement())
  description       String
  imageUrl          String
  price             Float
  location          String?
  isDraft           Boolean         @default(true)
  createdAt         DateTime        @default(now())
  originalContent   OriginalContent @relation(fields: [originalContentId], references: [id])
  originalContentId Int             @unique
  comments          Comment[]
  hashtags          Hashtag[]
}

model OriginalContent {
  id        Int       @id @default(autoincrement())
  imageUrl  String
  createdAt DateTime  @default(now())
  updatedAt DateTime? @updatedAt
  nft       Nft?
  minter    Minter    @relation(fields: [minterId], references: [id])
  minterId  Int
}

model Report {
  id        Int      @id @default(autoincrement())
  content   String
  createdAt DateTime @default(now())
  minterId  Int?
  teaBagId  Int?
  commentId Int?
  Minter    Minter?  @relation(fields: [minterId], references: [id])
  TeaBag    TeaBag?  @relation(fields: [teaBagId], references: [id])
  Comment   Comment? @relation(fields: [commentId], references: [id])
}

model TeaBag {
  id         Int       @id @default(autoincrement())
  name       String
  bio        String
  profileUrl String
  createdAt  DateTime  @default(now())
  updatedAt  DateTime? @updatedAt
  Report     Report[]
}

Environment & setup

Prisma logs

No response

janpio commented 3 months ago

What is hiding behind "Show details" in that error modal?