barrettshepherd
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
Do you think it's possibly just an auth issue with my postgres db and it's just returning that error? I can't find anything online.
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
You just need to set the secret to DB_URL
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
I just tried the tutorial over again to rule out anything weird I did and the same sockets error. https://github.com/shepherdindustries/CFWorkerTest
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
I tried both deploying and dev, same issue with both
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
@thanhle yup
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
@thanhle
{
"name": "worker",
"version": "0.0.0",
"private": true,
"scripts": {
"deploy": "wrangler deploy",
"dev": "wrangler dev",
"start": "wrangler dev"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240405.0",
"typescript": "^5.0.4",
"wrangler": "^3.0.0"
},
"dependencies": {
"pg": "^8.11.5"
}
}
19 replies
CDCloudflare Developers
•Created by barrettshepherd on 4/17/2024 in #workers-help
Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".
@thanhle thank you! When I've tried:
compatibility_flags = [ "nodejs_compat" ]
I just get hit with like 20 errors all related to the 'pg' module.
✘ [ERROR] Build failed with 22 errors:
node_modules/pg-cloudflare/dist/index.js:1:29: ERROR: Could not resolve "events"
node_modules/pg-connection-string/index.js:76:77: ERROR: Could not resolve "fs"
node_modules/pg-pool/index.js:2:29: ERROR: Could not resolve "events"
node_modules/pg/lib/client.js:3:27: ERROR: Could not resolve "events"
node_modules/pg/lib/connection-parameters.js:3:18: ERROR: Could not resolve "dns"
...
I don't have pg-cloudflare in my package.json but I guess it's being installed by pg.
"pg": "^8.11.5"
19 replies