Prisma hanging on cloudflare
Hello! I am using Prisma ORM on cloudflare workers and I am seeing quite a strange error:
Is this some known prisma issue on cloudflare edge runtime? Never happened before in Verce serverless afaik.
Any help would be useful, thank you so much in advance. π
This is my worker code:
9 Replies
You decided to hold for human wisdom. We'll chime in soon! Meanwhile,
#ask-ai is there if you need a quick second opinion.Hey!
I haven't ran or encountered this error before.
Is this happening on latest prisma version?
Did you follow these instructions?
https://www.prisma.io/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare
Deploy to Cloudflare Workers & Pages | Prisma Documentation
Learn the things you need to know in order to deploy an app that uses Prisma Client for talking to a database to a Cloudflare Worker or to Cloudflare Pages.
Followed every instruction on the internet I've found in the last 9 days.
I cannot get database connected from Prisma to CF Workers
@Nurul apologies for the ping. I can now provide with a repro: https://github.com/ineshbose/nitro-prisma-cloudflare-issue
OK I got response from Nitro's author: https://github.com/nitrojs/nitro/issues/3403#issuecomment-3211667384
GitHub
Module Path Resolution Error When Using Monorepo + Nitro + Prisma ...
Environment Linux x64, NodeJS v22.15.0 Reproduction I've created a minimal reproduction repo using pnpm monorepo + Nitro + Prisma, which reliably reproduces the bug on my machine (Linux x64, No...
Btw this is fixed in prisma version 6.15.0
yes - thanks! caught that π
just that dev environment is broken due to Rollup misconfiguring path to the wasm compiler
Hi,
I'm encountering the same issue with Prisma (v6.16.2) when connecting to a PostgreSQL database (AWS Aurora) via Hyperdrive in Cloudflare Workers. The Worker often hangs or throws errors during database connection, particularly during the initial request.
Setup Details:
Prisma Version: 6.16.2 (@prisma/client, @prisma/adapter-pg)
Environment: Cloudflare Workers with Hyperdrive
Database: AWS Aurora PostgreSQL
Wrangler: Latest, with compatibility_flags = ["nodejs_compat"] in wrangler.toml
schema.prisma:
Prisma Client Instantiation:
The Worker frequently hangs (error: "Workers runtime canceled this request because it detected that your Worker's code had hung") during the first DB interaction in my worker. This happens inconsistently, during high load. Previously, I had maxUses: 1 in the PrismaPg config, which caused hangs; removing it to use default led to more frequent errors like stale connections.
donβt cache the prisma client in CF - I learnt