nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.16k stars 507 forks source link

Postgresql hungs infinitely on cloudflare #2779

Open cosbgn opened 3 weeks ago

cosbgn commented 3 weeks ago

Environment

cloudflare pages & workers (I tested both).

Reproduction

Try any postgres connection, for example: https://github.com/cosbgn/pg-cloudflare/blob/main/server/api/psql.js (email me for the password at username at gmail.)

You can test locally by running:

NITRO_PRESET=cloudflare_module npm run build and then: npx wrangler dev --remote .output/server/index.mjs --site .output/public --log-level debug

I think the issue is cause by nitro. On both workers dev and workers deployed it hungs forever.

I tested with multiple databases (Digital Ocean and Aiven/AWS).

Describe the bug

It just hungs forever and eventually it times out.

Additional context

No response

Logs

No response