CfSocket is not a constructor
I am trying to connect a postgres database via Hyperdrive inside Cloudflare Worker with Hono.
and I tried to follow this docs: https://developers.cloudflare.com/hyperdrive/get-started/#_top
when I run to run the application and test it, I got this runtime error:
1 Reply
Could you try using
@prisma/pg-worker instead of pg? It will give you a new Client() that is supported in the worker. (https://www.npmjs.com/package/@prisma/pg-worker)npm
@prisma/pg-worker
Prisma's lightweight version of "pg" for workers. Latest version: 6.9.0, last published: 22 days ago. Start using @prisma/pg-worker in your project by running
npm i @prisma/pg-worker. There are no other projects in the npm registry using @prisma/pg-worker.