Problem
We are seeing intermittent production database failures on Vercel when using the Bun runtime with Drizzle ORM and the Bun SQL driver against Supabase Postgres.
The error appears across normal application queries and results in HTTP 500 responses. A representative error is:
Error:
HTTPError: Failed query: select xxxx = $1
cause: PostgresError: unnamed prepared statement does not exist
code: ERR_POSTGRES_SERVER_ERROR
errno: 26000
routine: exec_bind_message
Current setup
- Runtime:
Bunon Vercel - ORM:
Drizzle - Driver:
drizzle-orm/bun-sql - Database:
SupabasePostgres - Client config: includes
prepare: false - Observed Version: Vercel using
Bun1.3.6in deployment/runtime logs
Why this is unexpected
We already disabled prepared statements in the Bun SQL client:
const client = new SQL({
url: process.env.DATABASE_URL,
prepare: false,
strict: true,
});
Despite that, the runtime still intermittently fails with unnamed prepared statement does not exist.
Suspected cause
This appears related to Bun SQL behavior on older Bun versions when prepare: false is used with pooled Postgres connections. My understanding is that newer Bun releases include a fix for unnamed prepared statements against PgBouncer/Supavisor-style pooling, but Vercel seems to be running Bun 1.3.6 for this deployment path.
Because Vercel currently documents bunVersion: "1.x" rather than exact patch pinning, we cannot explicitly force Bun 1.3.11+ ourselves.
What we need help with
- Can you confirm which
Bunpatch version is actually being used for our Vercel deployment/runtime? - Does Vercel’s
Bunruntime currently support theBun SQLfix for unnamed prepared statements with pooledPostgresconnections? - If not, is there a way to opt this project into a newer
Bunpatch version?
Impact
- Intermittent production
HTTP 500s - Failures affect standard read queries
- Issue is not deterministic, which makes it difficult to mitigate at the application layer
Mitigations
- I am unable to use
NodeJSruntime due to use onBun SQL - I prefer not to use another
NodeJSdriver, and would like to stick withBun SQL