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 reported #1034

Closed
kane1997 opened this issue Oct 6, 2022 · 3 comments
Closed

bug reported #1034

kane1997 opened this issue Oct 6, 2022 · 3 comments

Comments

@kane1997
Copy link

kane1997 commented Oct 6, 2022

Bug description

Invalid string length
RangeError: Invalid string length
at JSON.stringify ()
at xt.serialize (http://localhost:5555/assets/index.js:1:49974)
at xt.update (http://localhost:5555/assets/index.js:1:12197)
at Cc (http://localhost:5555/assets/vendor.js:50:6994)
at xt.n (http://localhost:5555/assets/vendor.js:50:6688)
at xt.update (http://localhost:5555/assets/index.js:1:49831)
at Cc (http://localhost:5555/assets/vendor.js:50:6994)
at xt.n (http://localhost:5555/assets/vendor.js:50:6688)
at http://localhost:5555/assets/index.js:1:83936
at Array.forEach ()

How to reproduce

Expected behavior

No response

Prisma information

Environment & setup

  • OS:
  • Browser:
  • Database:

Prisma logs

No response

@petradonka
Copy link
Contributor

What Prisma version and browser are you using? Could you share your schema file with us, so we can better debug the issue you're running into?

@kane1997
Copy link
Author

kane1997 commented Oct 9, 2022

prisma version: 4.4.0

`model User {
id Int @id @unique @default(autoincrement()) @Map("user_id")
email String @unique @Map("user_email")
name String? @Map("user_name")
password String @Map("user_password")
avatar String? @default("") @Map("user_avatar")
user_created_at DateTime @default(now())
user_updated_at DateTime? @updatedAt
user_created_by User? @relation("userBy", fields: [byUserId], references: [id])
byUserId Int? @unique
user_updated_by User? @relation("userBy")
roles Users_Roles[]
channels Sales_Channels_Users[]
roleCreatedBy Role[] @relation("roleCreatedBy")
roleUpdatedBy Role[] @relation("roleUpdatedBy")
permissionCreatedBy Roles_Permissions[] @relation("permissionCreatedBy")
permissionUpdatedBy Roles_Permissions[] @relation("permissionUpdatedBy")
usersRolesCreatedBy Users_Roles[] @relation("usersRolesCreatedBy")
usersRolesUpdatedBy Users_Roles[] @relation("usersRolesUpdatedBy")

@@Map("t_user")
}

model Role {
id Int @id @unique @default(autoincrement()) @Map("role_id")
role_name String? @unique
role_remark String? @default("")
role_created_at DateTime @default(now())
role_updated_at DateTime? @updatedAt()
role_created_by User? @relation(name: "roleCreatedBy", fields: [createId], references: [id], onDelete: Cascade, onUpdate: Cascade)
createId Int? @unique
role_updated_by User? @relation(name: "roleUpdatedBy", fields: [updateId], references: [id], onDelete: Cascade, onUpdate: Cascade)
updateId Int? @unique
users Users_Roles[]
roles_permissions Roles_Permissions[]

@@Map("t_role")
}

model Permission {
id Int @id @unique @default(autoincrement())
name String?
value Int?
roles_permissions Roles_Permissions[]

@@Map("t_permission")
}

model Roles_Permissions {
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade, onUpdate: Cascade)
roleId Int
permission Permission @relation(fields: [permissionId], references: [id], onDelete: Cascade, onUpdate: Cascade)
permissionId Int
role_permission_is_enabled Boolean @default(false)
role_permission_remark String?
role_permission_created_at DateTime @default(now())
role_permission_created_by User? @relation(name: "permissionCreatedBy", fields: [createId], references: [id], onDelete: Cascade, onUpdate: Cascade)
createId Int? @unique
role_permission_updated_at DateTime @updatedAt
role_permission_updated_by User? @relation(name: "permissionUpdatedBy", fields: [updateId], references: [id], onDelete: Cascade, onUpdate: Cascade)
updateId Int? @unique

@@id([roleId, permissionId])
@@Map("t_role_permission")
}

model Users_Roles {
user User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId Int
role Role @relation(fields: [roleId], references: [id], onDelete: Cascade, onUpdate: Cascade)
roleId Int
user_role_is_enabled Boolean @default(true)
user_role_remark String?
user_role_created_at DateTime @default(now())
user_role_created_by User @relation(name: "usersRolesCreatedBy", fields: [createId], references: [id], onDelete: Cascade, onUpdate: Cascade)
createId Int @unique
user_role_updated_at DateTime? @updatedAt
user_role_updated_by User? @relation(name: "usersRolesUpdatedBy", fields: [updateId], references: [id], onDelete: Cascade, onUpdate: Cascade)
updateId Int? @unique

@@id([userId, roleId])
@@Map("t_user_role")
}`

@petradonka
Copy link
Contributor

Thanks for the details! That'll help our engineering team look into this.

In the meantime, you might want to try clearing your IndexedDB as a workaround: #895 (comment)

@janpio janpio closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
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