studio icon indicating copy to clipboard operation
studio copied to clipboard

Prisma Studio getting an error after a successful save operation on a many to many MongoDB relationship

Open Signaturo opened this issue 3 years ago • 3 comments

What I'm doing: Adding some categories to the blueprint. I successfully added 2 categories to the same blueprint and after successfully saving the data and adding the ids of the 2 categories to the array, it started breaking. Ids of the selected categories are not added to the array and the cell itself is red.

I cleared indexedBD and restarted studio, tried it in other browsers and in incognito mode, but the problem could not be solved. Please help with a solution.

problem

image

  1. Prisma version (prisma -v or npx prisma -v):
prisma                  : 3.12.0-dev.10
@prisma/client          : 3.11.0
Current platform        : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 3f4e645b4b21517662fa7940520ce0b50303cb11 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine        : migration-engine-cli 3f4e645b4b21517662fa7940520ce0b50303cb11 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine    : introspection-core 3f4e645b4b21517662fa7940520ce0b50303cb11 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary           : prisma-fmt 3f4e645b4b21517662fa7940520ce0b50303cb11 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash    : 3f4e645b4b21517662fa7940520ce0b50303cb11
Studio                  : 0.458.0
Preview Features        : fullTextIndex, extendedIndexes, mongoDb
  1. Logs from Developer Tools Console or Command line, if any:

logs localhost-1647873424237.log logs localhost-1647873471985.log

  1. Does the issue persist even after updating to the latest prisma CLI dev version? (npm i -D prisma@dev)

Yes

  1. Prisma schema (if relevant):
model Blueprint {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  ID Int? @unique
  categories Category[] @relation(fields: [categoryIds], references: [id])
  categoryIds String[] @db.ObjectId 
}

model Category {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  ID Int? 
  name String
  blueprints Blueprint[] @relation(fields: [blueprintsIds], references: [id])
  blueprintsIds String[] @db.ObjectId
}

Signaturo avatar Mar 21 '22 12:03 Signaturo

Note: This from the logs is interesting

index.js:1 [StringListInput.constructor] Invalid initialValue {initialValue: undefined}
vendor.js:27 B {path: 'StringListInput.constructor', code: undefined, type: undefined, message: 'Invalid initialValue', stack: undefined, …}

and

vendor.js:297 invalid row index for ensureIndexVisible: 0
o.ensureIndexVisible @ vendor.js:297
vendor.js:50 [mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: 'Reaction[Autorun@7428]' TypeError: Cannot read properties of undefined (reading 'length')
    at e.getColumn (vendor.js:229)
    at e.getGridColumn (vendor.js:229)
    at e.setFocusedCell (vendor.js:297)
    at t.setFocusedCell (vendor.js:297)
    at index.js:1
    at vendor.js:50
    at s (vendor.js:50)
    at ac (vendor.js:50)
    at e.track (vendor.js:50)
    at e.onInvalidate (vendor.js:50)

Jolg42 avatar Mar 21 '22 17:03 Jolg42

Hello! I keep getting this same error. I need to operate on implicit m:n relationships, but this bug prevents me from doing so. Could you help me solve this problem.

Signaturo avatar Jun 10 '22 13:06 Signaturo

@Signaturo Unfortunately, I have no capacity at the moment to check

Do you still have this issue with the latest version (3.15.0)?

Jolg42 avatar Jun 10 '22 13:06 Jolg42

Hey :wave:

Prisma ORM 7 introduces a brand new standalone Studio, built from the ground up to work everywhere, with or without Prisma ORM. Consequently, all "old Studio" issues are being closed as there won't be any further work on it. :mega:

The new Studio is also available in the Prisma VS Code extension and in the Prisma Console application. :electric_plug:

Help shape, improve and fix the new Studio with us in this repository by submitting bug reports and feature requests. :construction_worker:

igalklebanov avatar Nov 20 '25 01:11 igalklebanov