Looks like you're missing a node

Looks like you're missing a node compatibility flag in your wrangler.toml. pg is the recommended driver, that one works quite well. Needs the flag though.
5 Replies
Chetan Bhadauria
If you want to take a look at my wrangler.jsonc file, it's below: { "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "my-app-test", "compatibility_date": "2025-08-15", "compatibility_flags": [ // Enable Node.js API // see https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag "nodejs_compat", // Allow to fetch URLs in your app // see https://developers.cloudflare.com/workers/configuration/compatibility-flags/#global-fetch-strictly-public "global_fetch_strictly_public", ], "assets": { "directory": ".open-next/assets", "binding": "ASSETS", }, }
AJR
AJROP2mo ago
Huh. This is the one.
// see https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag
"nodejs_compat",
// see https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag
"nodejs_compat",
What version of node-postgres?
Chetan Bhadauria
8.16.3 As far as I know, for it to work, minimum is 8.16.3 Also, when I navigates to /admin route for payloadcms admin panel, I get a different error: 500 Internal Server Error.
AJR
AJROP2mo ago
I'm afraid I'm not familiar with payloadCMS, so I'm not likely to be a ton of help in debugging this. My suggestion would be to get a mininum example working with just pg directly querying the DB, to iron out any issues with your config
Chetan Bhadauria
Actually, it's because of not having database url. I have already spent last 5 days trying to deploy on cloudflare workers with hyperdrive support.

Did you find this page helpful?