prisma / studio

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

BigInt issue? #879

Open LB22 opened 2 years ago

LB22 commented 2 years ago
  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
  2. 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)
  3. 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.

  4. 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: https://github.com/prisma/studio/issues/816#issuecomment-1010143567

Should this be closed?
Arrowana commented 2 years ago

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 commented 2 years ago

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