Closed mw10013 closed 5 months ago
Hi @mw10013, Brilliant feedback and thank you for the Pull request.
We will do some testing and get back to you.
Thank you.
Hi @mw10013, We checked your PR and we agree that changing the two offending imports might fix the problem for now. However, there is a good chance we could start using some other Node JS feature breaking the ESM compatibility.
As a strategic solution, We have updated the package to export both CommonJS and ESM format so that the build systems can pick up the appropriate format.
We have released a beta version 1.3.0-beta.0
to trial this approach. We will move it to the main branch after it is field tested for a while.
Please use the new version and let us know how it goes.
Thank you.
@vijayasingam-paddle 1.3.0-beta.0
works in my paddle-cloudflare-worker
smoke test (https://paddle-cloudflare-worker.mw10013.workers.dev/ displays the first page of products). Also, in the project I'm working on which includes reconciling database with paddle, changing subscriptions, and webhook. Gratitude!
Tell us about your feature request
Tweak
paddle-node-sdk
so that it runs on Cloudflare.What problem are you looking to solve?
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.Additional context
No response
How important is this suggestion to you?
Critical