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

BigInt issue? #879

Open
LB22 opened this issue Mar 15, 2022 · 2 comments
Open

BigInt issue? #879

LB22 opened this issue Mar 15, 2022 · 2 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: BigInt topic: Do not know how to serialize a BigInt

Comments

@LB22
Copy link

LB22 commented Mar 15, 2022

  1. Prisma version (prisma -v or npx prisma -v):
prisma                  : 3.10.0
@prisma/client          : 3.10.0
Current platform        : windows
Query Engine (Node-API) : libquery-engine 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules\@prisma\engines\query_engine-windows.dll.node)       
Migration Engine        : migration-engine-cli 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules\@prisma\engines\migration-engine-windows.exe)   
Introspection Engine    : introspection-core 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules\@prisma\engines\introspection-engine-windows.exe) 
Format Binary           : prisma-fmt 73e60b76d394f8d37d8ebd1f8918c79029f0db86 (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash    : 73e60b76d394f8d37d8ebd1f8918c79029f0db86
Studio                  : 0.458.0
  1. Logs from Developer Tools Console or Command line, if any:
TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at new er (http://localhost:5555/assets/index.js:1:162650)
    at bs (http://localhost:5555/assets/vendor.js:27:50128)
    at Ha (http://localhost:5555/assets/vendor.js:27:67591)
    at bl (http://localhost:5555/assets/vendor.js:27:105796)
    at gu (http://localhost:5555/assets/vendor.js:27:97229)
    at hu (http://localhost:5555/assets/vendor.js:27:97154)
    at iu (http://localhost:5555/assets/vendor.js:27:94183)
    at http://localhost:5555/assets/vendor.js:27:45779
    at e.unstable_runWithPriority (http://localhost:5555/assets/vendor.js:18:3854)
  1. Does the issue persist even after updating to the latest prisma CLI dev version? (npm i -D prisma@dev)
    Got this warning: Versions of prisma@3.11.0-dev.61 and @prisma/client@3.10.0 don't match.
    Tried to run prisma studio anyways, the issue persisted.

  2. Prisma schema (if relevant):

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

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

model customer {
  id                  BigInt    @id @unique @default(autoincrement())
  created_at          DateTime? @default(now()) @db.Timestamptz(6)
  first_name          String?   @db.VarChar
  last_name           String?   @db.VarChar
  email_address       String?   @db.VarChar
  mobile_phone_number String?   @db.VarChar
  orders              order[]
}

model order {
  id                       BigInt    @id @unique @default(autoincrement())
  created_at               DateTime? @default(now()) @db.Timestamptz(6)
  stripe_payment_intent_id String?   @unique @db.VarChar
  products                 Json[]    @db.Json
  customer                 customer? @relation(fields: [customerId], references: [id])
  customerId               BigInt
}

So, I created 2 customers and 1 order. At first I set customer 1 as owner of the order. Then I switched the order to have the second customer as owner of the order. Then I tried clicking on any of the "order" buttons under the customer table and then prisma studio gave me the type error.

I tried changing the id types from BigInt to Int and re-did the whole operation. Now it works fine.

Is there some issue with BigInt?

Just saw that this is a duplicate and this issue has been posted here too: #816 (comment)

Should this be closed?

@janpio janpio added kind/bug A reported bug. topic: BigInt labels Mar 21, 2022
@Arrowana
Copy link

Arrowana commented Sep 13, 2022

This is still an issue and also breaks the cloud prisma studio

npx prisma --version
prisma : 4.3.1
@prisma/client : 4.3.1
Current platform : darwin
Query Engine (Node-API) : libquery-engine c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt c875e43600dfe042452e0b868f7a48b817b9640b (at node_modules/@prisma/engines/prisma-fmt-darwin)
Format Wasm : @prisma/prisma-fmt-wasm 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b
Default Engines Hash : c875e43600dfe042452e0b868f7a48b817b9640b
Studio : 0.473.0

@petradonka
Copy link
Contributor

Hi @Arrowana - we have been unable to reproduce this issue. If you can consistently reproduce it, would you be able to record a Replay.io session for us to get more info on this issue? We'd really appreciate the help. Here's how you can do that: https://docs.replay.io/docs/recording-bug-reports-80c37d7d6753485f81497570625d06f0

@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. topic: Do not know how to serialize a BigInt labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: BigInt topic: Do not know how to serialize a BigInt
Projects
None yet
Development

No branches or pull requests

4 participants