Skip to content

[Bug] RangeError: Invalid string length #867

@rahXephonz

Description

@rahXephonz
  1. Prisma version (^3.8.0 ):

  2. Logs from Developer Tools Console or Command line, if any:

Invalid string length
RangeError: Invalid string length
    at JSON.stringify (<anonymous>)
    at _t.serialize (http://localhost:5555/assets/index.js:1:49091)
    at _t.update (http://localhost:5555/assets/index.js:1:12197)
    at Cc (http://localhost:5555/assets/vendor.js:50:6994)
    at _t.n (http://localhost:5555/assets/vendor.js:50:6688)
    at _t.update (http://localhost:5555/assets/index.js:1:48948)
    at Cc (http://localhost:5555/assets/vendor.js:50:6994)
    at _t.n (http://localhost:5555/assets/vendor.js:50:6688)
    at http://localhost:5555/assets/index.js:1:82151
    at Array.forEach (<anonymous>)
  1. Does the issue persist even after updating to the latest prisma CLI dev version? (^3.8.0)

  2. Prisma schema (if relevant):

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

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

model User {
  id          String     @id @default(cuid())
  username    String?    @unique
  name        String?
  email       String?    @unique
  avatarUrl   String?
  password    String?
  bio         String?
  googleId    String?    @unique
  slug        String?
  coverPhoto  String?
  token       String?    @unique
  isCreator   Boolean    @default(false)
  isVerified  Boolean    @default(false)
  createdAt   DateTime   @default(now()) @map(name: "created_at")
  updatedAt   DateTime   @default(now()) @map(name: "updated_at")
  following   User[]     @relation(name: "FollowRelation", references: [id])
  followers   User[]     @relation(name: "FollowRelation", references: [id])
  likes       LikedPost[]
  posts       Post[]
  comments    Comment[]
  profession  Profession[]

  @@map(name: "users")
}


model Post {
  id        String      @id @default(cuid())
  likes     LikedPost[]
  comments  Comment[]
  content   String
  published Boolean    @default(false)
  createdAt DateTime   @default(now()) @map(name: "created_at")
  updatedAt DateTime   @default(now()) @map(name: "updated_at")
  authorId  String        
  author    User       @relation(fields: [authorId], references: [id])

  @@map(name: "posts")
}

model LikedPost {
  id      Int      @id @default(autoincrement())
  post    Post     @relation(fields: [postId], references: [id])
  user    User     @relation(fields: [userId], references: [id])
  date    DateTime @default(now())
  postId  String
  userId  String

  @@map(name: "likedposts")
}

model Comment {
  id        Int      @id @default(autoincrement())
  text      String
  post      Post     @relation(fields: [postId], references: [id])
  user      User     @relation(fields: [userId], references: [id])
  userId    String
  postId    String
  date      DateTime @default(now())

  @@map(name: "comments")
}


model Profession{
  id          Int        @default(autoincrement()) @id
  role        String     @unique
  userId      String
  user        User       @relation(fields: [userId], references: [id])

  @@map(name: "profession")
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions