Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] RangeError: Invalid string length #867

Closed
rahXephonz opened this issue Mar 2, 2022 · 7 comments
Closed

[Bug] RangeError: Invalid string length #867

rahXephonz opened this issue Mar 2, 2022 · 7 comments

Comments

@rahXephonz
Copy link

  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")
}

@Matzu89
Copy link

Matzu89 commented Mar 11, 2022

Same here.

Environment variables loaded from .env
prisma                  : 3.10.0
@prisma/client          : 3.10.0
Current platform        : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine        : migration-engine-cli 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine    : introspection-core 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary           : prisma-fmt 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash    : 73e60b76d394f8d37d8ebd1f8918c79029f0db86
Studio                  : 0.458.0
Preview Features        : mongoDb

@rahXephonz
Copy link
Author

I solved this issue by opening prisma in another web like edge this issue running only on chrome and Firefox but if you open the prisma engine at incognito it's working fine too. Try it

@Matzu89
Copy link

Matzu89 commented Mar 11, 2022

Fixed this by removing and clearing site data. To be specific: clear IndexedDB.

image

@rahXephonz
Copy link
Author

rahXephonz commented Mar 11, 2022

Fixed this by removing and clearing site data. To be specific: clear IndexedDB.

image

Wow, Yeah I just knowing that. Thanks for information 😉

@rahXephonz
Copy link
Author

Fix and the solutions in comment. 🙏

@janpio
Copy link
Contributor

janpio commented Mar 21, 2022

Reopened as comment only is a workaround, not the actual fix to the problem. We also do not know what is causing the problem in the first place.

@janpio
Copy link
Contributor

janpio commented Apr 14, 2022

See #895

@janpio janpio closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants