question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No such argument error in relations with prisma2 beta1

See original GitHub issue

Hello to all.

I am using @prisma/cli”: “^2.0.0-beta.1”,

I have schema definition like:

someFieldX       TypeX @relation(fields: [someFieldXId], references: [id])
someFieldXId     String

When trying to run prisma2 generate I am getting the following error:

Error: Schema parsing error: No such argument.

And the issue seems to be fields: [someFieldXId] as this is highlighted in red

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ranjan-purbeycommented, Apr 2, 2020

@JCLMAQ I think this error is being thrown because you are using an old version of prisma (the generate command that you are using is npx prisma2 generate instead of the one from 2.0.0-beta.1 which is npx prisma generate). Please update prisma to v2.0.0-beta.1 and that should resolve the issue.

@akoufa are you too using the old version?

1reaction
akoufacommented, Apr 3, 2020

@ranjan-purbey

Yes I already had deleted node_modules and lock file.

npx prisma -v output:

npx: installed 593 in 18.556s
Prisma CLI version: prisma/1.34.10 (darwin-x64) node-v12.16.1

But I used npm cache clean --force

And now it get’s the correct version. So I will close the issue. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >
M-N relationships are not working with migrations
bin/prisma2 migrate save --experimental error: No such argument. We successfully received the error report To help us even more, please create ...
Read more >
Unknown argument error when creating record - Stack Overflow
Prisma essentially generates two type definitions for a create query. This is implemented with a XOR type, which ensures that only one ...
Read more >
typegraphql-prisma: Versions - Openbase
Supported Prisma version has been bumped to v4.8.0 No changes in DMMF ... It allows using conditions while getting relations count. ... 0.21.6-beta.1....
Read more >
Working With Prisma 2: Many-to-Many Relations - YouTube
In this video we deal with many-to-many relations using Prisma 2. Prerequisites: Familiarity with Node.js, TypeScript, and using an ORM such ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found