Closed mw10013 closed 6 months ago
Closes #9
paddle-node-sdk does not run on Cloudflare because it imports crypto without a node: prefix. Node.js compatibility in Cloudflare requires the node: prefix per https://developers.cloudflare.com/workers/runtime-apis/nodejs/
crypto
node:
paddle-node-sdk is cjs and node:crypto on Cloudflare seems to be esm. Cjs must use a dynamic import to import esm.
paddle-node-sdk
node:crypto
This PR dynamically imports 'node:crypto'.
In my local environment, 4 tests fail when I run the latest main in paddle-node-sdk. These 4 failures persist with this PR.
main
https://github.com/mw10013/paddle-cloudflare-worker contains a Cloudflare worker that uses this PR to show the first page of products on Cloudflare. It is deployed here: https://paddle-cloudflare-worker.mw10013.workers.dev/
Superseded by #20
Closes #9
paddle-node-sdk does not run on Cloudflare because it imports
crypto
without anode:
prefix. Node.js compatibility in Cloudflare requires thenode:
prefix per https://developers.cloudflare.com/workers/runtime-apis/nodejs/paddle-node-sdk
is cjs andnode:crypto
on Cloudflare seems to be esm. Cjs must use a dynamic import to import esm.This PR dynamically imports 'node:crypto'.
In my local environment, 4 tests fail when I run the latest
main
inpaddle-node-sdk
. These 4 failures persist with this PR.https://github.com/mw10013/paddle-cloudflare-worker contains a Cloudflare worker that uses this PR to show the first page of products on Cloudflare. It is deployed here: https://paddle-cloudflare-worker.mw10013.workers.dev/