PrismaP
Prisma8mo ago
3 replies
Max

Prisma PG adapter error in hosted environments (`this.client.connect(...).catch is not a function`)

TypeError: this.client.connect(...).catch is not a function
  File "/app/node_modules/@prisma/adapter-pg/dist/index.js", line 584, col 51, in PrismaPgAdapter.startTransaction
    const conn = await this.client.connect().catch((error) => this.onError(error));
  File "/app/node_modules/@prisma/client/runtime/client.js", line 71, col 31668, in #r
  File "node:internal/process/task_queues", line 95, col 5, in process.processTicksAndRejections
  File "/app/node_modules/@prisma/client/runtime/client.js", line 71, col 31296, in Or.startTransaction
  File "/app/node_modules/@prisma/client/runtime/client.js", line 71, col 25694, in e.interpretNode
  File "/app/node_modules/@prisma/client/runtime/client.js", line 71, col 23373, in e.run
  File "/app/node_modules/@prisma/client/runtime/client.js", line 72, col 2001, in Ft.request
  File "/app/node_modules/@prisma/client/runtime/client.js", line 81, col 5885, in Object.singleLoader
  File "/app/node_modules/@prisma/client/runtime/client.js", line 81, col 6377, in ni.request
  File "/app/node_modules/@prisma/client/runtime/client.js", line 90, col 9782, in l
  File "/app/services/xyz/xyz.ts", line 219, col 33, in XyzService_1.XyzService.storeXyz
    const xyz = await this.prisma.xyz.create({

This is using 6.10.1 with
pg
8.16.1, pg-pool 3.10.1
The confusing thing is that this only occurs in the hosted environment on AWS ECS. I've tried building the container image and running it locally and it works just fine. This did not happen with @prisma/adapter-pg 5.22.0. I have tried it both with and without the new queryCompiler preview feature.

Is there anything I can do to reproduce this or narrow down the cause?
Was this page helpful?