error: Connection terminated unexpectedly
hi i am making a nodejs application that uses drizzle neon database. However, it terminates itself even though i do not do anything after a few minutes later.


6 Replies
This is something on the driver. Drizzle is probably not terminating your connection
Hmm, I understand. I'll contact the neon support.
actually I realised that it waits a long time after any drizzle code, and give this error
and if i change pool to https my connection, gives this error

Try to run a query with the neon connection only, without drizzle and start troubleshooting from there
okey
i did neon example and works well
// app.js
const postgres = require('postgres');
require('dotenv').config();
let { PGHOST, PGDATABASE, PGUSER, PGPASSWORD, ENDPOINT_ID } = process.env;
const sql = postgres({
host: PGHOST,
database: PGDATABASE,
username: PGUSER,
password: PGPASSWORD,
port: 5432,
ssl: 'require',
connection: {
options:
project=${ENDPOINT_ID},
},
});
async function getPgVersion() {
const result = await sql
select version();
console.log(result);
}
getPgVersion();
and my another drizzle nextjs app works well
What could I have done wrong?
I was using cloudflare warp to change my DNS and it was not working properly along with bun and drizzle because I left it on. I solved the problem by switching off the warp.No idea what that means but good deal!