prisma / studio

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

index.js:1 Uncaught RangeError: Invalid array length #798

Open fgirolami29 opened 2 years ago

fgirolami29 commented 2 years ago

index.js:1 Uncaught RangeError: Invalid array length at Ke (index.js:1) at Qe (index.js:1) at Kl.copyToClipboard (index.js:1) at onMatch (index.js:1) at index.js:1 at h (vendor.js:71) at y.t._handleKey (vendor.js:71) at y.handleKey (vendor.js:71) at HTMLDivElement.g (vendor.js:71)

image

still waitin' for a quick fix please

sdnts commented 2 years ago

Hey @fgirolami29, when exactly does this happen? Can you narrow down what you did to trigger this? It'll be easier to reproduce on my end if so, thanks!

fgirolami29 commented 2 years ago

when i want copy to clipboard the selected rows as json, i tried with windows , mac os , chrome ,safari and firefox

fgirolami29 commented 2 years ago

just updated prisma studio , bug persists

Mozartted commented 2 years ago

Same issue here, is there any resolution? @fgirolami29 any luck?

alfredbirk commented 2 years ago

Hi, I get the same error. It happens when I select some rows and press cmd + c. The intended functionality is described in https://github.com/prisma/studio/issues/634

petradonka commented 2 years ago

@alfredbirk, which Prisma version are you using? We've recently shipped some changes related to cmd-C, so want to make sure we know which version you have. Does it consistently happen when you use the copy feature? Is it when you select any rows, or specific ones?

alfredbirk commented 2 years ago

@petradonka I used 3.15.1. It happened consistently on all rows, both when I selected one or many.

I now upgraded to 4.2.1. Now I don't get an error, but it just copies "undefined". It happens with any row I select, in any model, and also when I select multiple rows. Nothing is logged in console.

petradonka commented 2 years ago

@alfredbirk, thanks for the additional info. Which browser are you using? How does the model/schema look like for the rows you're trying to copy? Are you using Studio or the Data Browser in the Prisma Data Platform?

alfredbirk commented 2 years ago

@petradonka

Here is a video:

https://user-images.githubusercontent.com/11172530/185080246-1d0e8463-208d-44ff-ad54-ea82955f651e.mov

alfredbirk commented 2 years ago

@petradonka Tell me if you can't reproduce it, and I will try to make a minimal reproducible example.

petradonka commented 2 years ago

@alfredbirk, if you could send us a minimal reproducible example, that'd help us a lot to track down this issue! 👌

fgirolami29 commented 2 years ago

STEP 1 - npx prisma studio STEP 2 - open up the browser - navigate to a populated tablet STEP 3 - open up developer console STEP 4 - select and copy 1 or more rows STEP 5 - BUG , ERROR SHOWS UP IN THE CONSOLE , NO DATA COPIED TO CLIPBOARD

fgirolami29 commented 2 years ago

EDIT : tried now , no error in console , but when i want to copy into the clipboard some or one row , the clipboard goes to undefined

petradonka commented 2 years ago

We've released some improvements to copying rows in Prisma 4.3.0 and this should now work correctly and copy the JSON of the rows you've selected. Let us know if this fixes it for you!

fgirolami29 commented 2 years ago

Invalid array lenght solved, still it doesnt copy rows.

fgirolami29 commented 2 years ago

My clipboard now shows undefined image

petradonka commented 2 years ago

@fgirolami29, are you using 4.3.0 or 4.3.1? It sounds like you're getting the same behaviour as you did <4.3.0. Could you help with a bit more info to reproduce this? What's the schema of the model you're copying rows for? How many rows are you copying? Are there relations involved?

hbendev commented 1 year ago

I did encounter this issue. See environment details below.

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
cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"

I tried a number of different browsers, all running into the same error.

google-chrome --version
Google Chrome 110.0.5481.96 
firefox --version
Mozilla Firefox 110.0
microsoft-edge --version
Microsoft Edge 99.0.1150.30 
opera --version
83.0.4254.27

Are you using Studio or the Data Browser in the Prisma Data Platform?

Prisma studio.

What's the schema of the model you're copying rows for? Are there relations involved?

Occurs regardless the complexity of the model(s). I'm not able to copy a row for a simple model as below.

model Feedback {
  id        String   @id @default(cuid())
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  type        String
  email       String
  description String
}

How many rows are you copying? Is it when you select any rows, or specific ones? Does it consistently happen when you use the copy feature?

There's an error whether I have 1 or 10s of rows selected. I couldn't find a row for which it worked.

This seems to be a duplicate of https://github.com/prisma/studio/issues/776

hbendev commented 1 year ago

Updating to the most recent minor version doesn't solve the error

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

However I can confirm that a newer version of @prisma/studio has this resolved:

prisma                  : 4.10.1
@prisma/client          : 4.10.1
Current platform        : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine aead147aa326ccb985dcfed5b065b4fdabd44b19 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine        : migration-engine-cli aead147aa326ccb985dcfed5b065b4fdabd44b19 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Format Wasm             : @prisma/prisma-fmt-wasm 4.10.1-1.80b351cc7c06d352abe81be19b8a89e9c6b7c110
Default Engines Hash    : aead147aa326ccb985dcfed5b065b4fdabd44b19
Studio                  : 0.481.0