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

Unexpected Server Error Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'cloudflare:' #822

Open cloudcreatr opened 6 months ago

cloudcreatr commented 6 months ago

Unexpected Server Error

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'cloudflare:'

i am trying to connect to supabase with cloudflare workers in pages. i am using drizzle but i am getting this error..

tukiminya commented 6 months ago

I have the same problem to connect Neon database with Remix + Vite + Cloudflare pages. Please check reference repository.

https://github.com/tukiminya/remix_vite_postgresjs_issue

l4j3b commented 5 months ago

Same issue, it works in prod though, it is only locally that it does not...

oristian commented 5 months ago

In the same boat here - and losing remix dev hrm by having to run npm run preview and exit and repeat is a DX killer

anyuruf commented 5 months ago

I was getting similar errors in my Remix, Drizzle and cloudflare app and I think it's some to do with running remix dev instead of wrangler dev when you using cloudflare services like D1 database, Hyperdrive(For postgres) and so on. Check the link https://www.jacobparis.com/content/remix-cloudflare-pages

divyenduz commented 3 months ago

Related issue on Remix side (has more context and a workaround that works): https://github.com/remix-run/remix/issues/9245#issuecomment-2179517678