Ebuka
Ebuka

Reputation: 49

NeonDB Fetch Error with drizzleORM: Cannot connect to neon database from Next js 14 app to fetch data but connects for mutations

I'm trying to fetch data from my db in a server component but I keep getting this connection error

⨯ NeonDbError: Error connecting to database: fetch failed
at async page (./src/app/tailor-cv/job/[id]/page.tsx:18:17)
digest: "4084647856"

I don't know what the issue is, but I successfully made mutations to the same database in this same Next.Js 14 app. But the fetch calls seem to be having this connection error. Can anyone help me out enter image description here

This is a screenshot from the console

Upvotes: 2

Views: 514

Answers (1)

jethiya007
jethiya007

Reputation: 57

[TEMP FIX]

I am also experiencing the same problem the stack i am using is this:

  • Next14
  • Postgres
  • Drizzle
  • Neon

and when i was trying to call db on my wifi it was not working but the moment i changed the wifi to my neighbours it started working.

This is a temporary fix I can find for now, I'll update this answer if i found something solid.

Try checking for these ISP issues:

  • Your ISP might be blocking some outbound connections
  • Contact your ISP to check if they're blocking PostgreSQL connections
  • Consider using a VPN as a last resort if your ISP is the problem

Upvotes: 0

Related Questions