Error connection terminated unexpectedly
Hi π
New user of neon here.
I am trying to connect to a DB from a local nextjs execution using the
@neondatabase/serverless
But I always get
When i connect with psql its working well. π¦
and even when im connecting with pg but without the nextjs.
full stack is: NextJS14 & Kysely
Would love to know what I am doing wrong.8 Replies
xenogeneic-maroonβ’2y ago
Hey, can you try running something simple like this script?
I run it using:
Does that work for you?
IF so, then can you share more details? For example, the driver version and if you're using an ORM
other-emeraldOPβ’2y ago
this is working perfectly π
As mentioned above I am using Kysely.
"kysely": "^0.27.2",
"@neondatabase/serverless": "^0.7.2",
When I did the exact same thing but with kysely as you can see above I got the error:
other-emeraldOPβ’2y ago
as you can see from the guide /
https://github.com/neondatabase/neon-vercel-kysely/blob/main/api/sites.ts
GitHub
neon-vercel-kysely/api/sites.ts at main Β· neondatabase/neon-vercel-...
Example use of Neon serverless driver on Vercel Edge Functions with Kysely and kysely-codegen - neondatabase/neon-vercel-kysely
other-emeraldOPβ’2y ago
When I do it with the ws it works:
but then when I run it with NextJS it does not work:
xenogeneic-maroonβ’2y ago
Can you try this: https://discord.com/channels/1176467419317940276/1176467419938701375/1196916871367229570
A user reported this same error in the past
other-emeraldOPβ’2y ago
wow this is working super weird :S
But thanks!
xenogeneic-maroonβ’2y ago
You're welcome, glad it got you unblocked. Do you think this is something Kysely need to add in their documentation?
Or maybe it's a Next.js bundling iss\ue?
other-emeraldOPβ’2y ago
hmm i have no idea :S
seems more like its a next bundling issue