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.

PANIC: expected 0 parameters but got 1

See original GitHub issue

Hi Prisma Team! My Prisma Client just crashed. This is the report:

Versions

Name Version
Node v12.18.3
OS darwin
Prisma Client 2.9.0

Logs

  prisma-client {
  prisma-client   engineConfig: {
  prisma-client     cwd: '/Users/utopiabeam/Projects/shop-server/.webpack/service/node_modules/layers/prisma',
  prisma-client     enableDebugLogs: false,
  prisma-client     enableEngineDebugMode: undefined,
  prisma-client     datamodelPath: '/Users/utopiabeam/Projects/shop-server/.webpack/service/node_modules/layers/prisma/schema.prisma',
  prisma-client     prismaPath: undefined,
  prisma-client     engineEndpoint: undefined,
  prisma-client     generator: {
  prisma-client       name: 'client',
  prisma-client       provider: 'prisma-client-js',
  prisma-client       output: '/Users/utopiabeam/Projects/shop-server/layers/prisma',
  prisma-client       binaryTargets: [Array],
  prisma-client       previewFeatures: [Array],
  prisma-client       config: {},
  prisma-client       isCustomOutput: true
  prisma-client     },
  prisma-client     showColors: false,
  prisma-client     logLevel: undefined,
  prisma-client     logQueries: true,
  prisma-client     flags: [],
  prisma-client     clientVersion: '2.9.0',
  prisma-client     enableExperimental: [ 'transaction' ],
  prisma-client     useUds: undefined
  prisma-client   }
  prisma-client }  
  plusX Have to call plusX on /Users/utopiabeam/Projects/shop-server/.webpack/service/node_modules/layers/prisma/query-engine-darwin  
  prisma-client Prisma Client call:  
  prisma-client prisma.queryRaw(SELECT "userId" FROM "UserShopPermissions" WHERE "shopId"='$1', ["test-shop"])  
  plusX Execution permissions of /Users/utopiabeam/Projects/shop-server/.webpack/service/node_modules/layers/prisma/query-engine-darwin are fine  
  plusX Execution permissions of /Users/utopiabeam/Projects/shop-server/.webpack/service/node_modules/layers/prisma/query-engine-darwin are fine  

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pantharshit00commented, Jan 27, 2021

@UtopiaBeam If you refer it by prepared variable name then pass the variable as an option. Otherwise, this is possible and this is safe to injection as we will insert a prepared variable:

let myvar = "test";
prisma.$queryRaw`SELECT "userId" FROM "UserShopPermissions" WHERE "shopId"=${test}`;

0reactions
UtopiaBeamcommented, Jan 9, 2021

Sorry for late reply here @UtopiaBeam but you need to pass prepared variables like so:

prisma.$queryRaw('SELECT "userId" FROM "UserShopPermissions" WHERE "shopId"=\'$1\'', "test-shop");

So it’s impossible to use tagged template calling?

Read more comments on GitHub >

github_iconTop Results From Across the Web

panic: sql: expected 0 arguments, got 1 - Stack Overflow
The error is telling you that you are passing an argument to QueryRow that it is not expecting. Your SQL statement doesn't have...
Read more >
expected 0 parameters but got 1 (when running $executeRaw ...
Hey I'm trying to run this simple statement, but I get a panic crash. const newPassword = 'ElitePassword'; await prisma.
Read more >
Mysql – panic: sql: expected 0 arguments, got 1 – iTecNote
I am trying to execute queries with Go, but I cannot manage to request any query, because it keeps giving me the same...
Read more >
Expected 0 arguments, but got 1 error in TypeScript | bobbyhadz
The error "Expected 0 arguments, but got 1" occurs when we pass an argument to a function that doesn't take any arguments. To...
Read more >
Mysql statement problem - Getting Help - Go Forum
So I had no idea this function returned anything. Secondly, the return I'm getting says “sql: expected 0 arguments, got 1” But in...
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