You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
harrispap03
changed the title
Remove dependency to crypto so node-postgress can run on the edge
Remove dependency to crypto so node-postgres can run on the edge
Aug 31, 2023
node_modules can be used, as long as they implement ES Modules and do not use native Node.js APIs
though? pg isn’t ESM-based, and uses other Node APIs, like net. pg includes a Node-like API wrapper for Cloudflare Workers, but I don’t even see the ability to make TCP connections in the linked documentation.
I had the same problem for Cloudflare Pages, I ended up patching the package, removing any require('crypto') calls, since this was the cause. Basically my edge function fell even before execution of the function logic itself, it fell in the import stage.
I'm using
node-postgres
alongside withdrizzle-orm
.I'd like to be able to make queries on the edge, though that's not possible due to the dependency of
node-postgres
to thecrypto
library.Is there a chance it can be removed on the future so it can run on the edge ?
Edge reference here
The text was updated successfully, but these errors were encountered: