porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.38k stars 267 forks source link

CONNECT_TIMEOUT error #851

Closed henryzhang03 closed 5 months ago

henryzhang03 commented 5 months ago

I am running this client on Bun, and upon running it, it always runs into a code "CONNECT_TIMEOUT" error on even the first request. My connection setup is:

  db = postgres(process.env.DB_CONNECTION_STRING!, {
    host: process.env.DB_HOST, // Postgres ip address[s] or domain name[s]
    port: Number(process.env.DB_PORT), // Postgres server port[s]
    database: process.env.DB_NAME, // Name of database to connect to
    username: process.env.DB_USERNAME, // Username of database user
    password: process.env.DB_PASSWORD // Password of database user
  });

I don't really know whats going on, but was wondering if I was doing something wrong or if this is a known issue.

porsager commented 5 months ago

it's a bug in bun if the same thing works with node 😉 https://github.com/porsager/postgres/issues/817#issuecomment-2030285794