Prisma-client-js: PANIC: expected array type

Created on 15 Aug 2020  路  3Comments  路  Source: prisma/prisma-client-js

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

Versions

| Name | Version |
|----------|--------------------|
| Node | v14.5.0 |
| OS | darwin |
| Prisma | 2.4.1 |

Code:

prisma.$executeRaw`UPDATE "Table" SET "column" = 1 WHERE id IN (${[1, 2, 3]})`

Logs

  prisma-client {
  prisma-client   engineConfig: {
  prisma-client     cwd: '/Users/path/prisma',
  prisma-client     enableDebugLogs: false,
  prisma-client     enableEngineDebugMode: undefined,
  prisma-client     datamodelPath: '/Users/path/node_modules/.prisma/client/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/path/node_modules/@prisma/client',
  prisma-client       binaryTargets: [],
  prisma-client       previewFeatures: [Array],
  prisma-client       config: {}
  prisma-client     },
  prisma-client     showColors: false,
  prisma-client     logLevel: undefined,
  prisma-client     logQueries: true,
  prisma-client     flags: [],
  prisma-client     clientVersion: '2.4.1',
  prisma-client     enableExperimental: [ 'transaction', 'aggregations' ]
  prisma-client   }
  prisma-client }  +0ms
  plusX Execution permissions of /Users/path/node_modules/.prisma/client/query-engine-darwin are fine  +0ms
  prisma-client Client Version 2.4.1  +42ms
  prisma-client Engine Version 195d4bdc2d16132977f4ba7a8ca312f7906cb086  +0ms
  plusX Execution permissions of /Users/path/node_modules/.prisma/client/query-engine-darwin are fine  +61ms
  prisma-client Prisma Client call:  +53ms
  prisma-client prisma.executeRaw(UPDATE "Table" SET "column" = $1 WHERE id IN ($2), [1,[1,2,3]])  +1ms
bu0-needs-info kinbug statuneeds-action basic reporting issue

Most helpful comment

@mrmntte
You've bumped into a tricky issue. Fortunately, Prisma has got our back

You should be using the "join" helper from the @prisma/client. See Below

import { join } from "@prisma/client";

const ids = [1, 3, 5, 10, 20];
const result = await prisma.$queryRaw`SELECT * FROM User WHERE id IN (${join(
  ids
)})`;

All 3 comments

Hello! Can you please provide a minimal reproduction for the above crash? Unfortunately the automatically collected information in the issue does not give us much to go with here - we will need a bit more information. What were you doing? Can you share the code and schema that was active?

@mrmntte
You've bumped into a tricky issue. Fortunately, Prisma has got our back

You should be using the "join" helper from the @prisma/client. See Below

import { join } from "@prisma/client";

const ids = [1, 3, 5, 10, 20];
const result = await prisma.$queryRaw`SELECT * FROM User WHERE id IN (${join(
  ids
)})`;

I am going to close this as its been 3 months now and there is no activity here.

Please reply if you want us to take another look.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

samrith-s picture samrith-s  路  3Comments

Vergil333 picture Vergil333  路  3Comments

divyenduz picture divyenduz  路  4Comments

nikolasburk picture nikolasburk  路  3Comments

divyenduz picture divyenduz  路  3Comments