Cloudflare Workers - Using stripe-node

I’m trying to use stripe-node on my cloudflare worker. But I get this error when pushing the code.

Error: Something went wrong! Status: 400 Bad Request, Details {
  "result": null,
  "success": false,
  "errors": [
      "code": 10021,
      "message": "Uncaught TypeError: r(...).createServer is not a function\n  at line 8\n  at line 8\n  at line 1 in r\n  at line 8\n  at line 1 in r\n  at line 1\n  at line 1\n"
  "messages": []

I have created this issue but they say I cna not use stripe-node on Cloudflare Workers, is that true, is there a work around?

Cloudflare Workers don’t have the Node API, you have to use vanilla JS for everything.

stripe-node is probably trying to create a Node http server, but no such concept exist on Workers.

1 Like

That’s what I thought, I was confused by this:

That’s understandable. Unfortunately there’s very few node packages that work in workers, in general, if you suspect it needs to make use of http server, then it will never work, there’s too deep of a dependency on Node API’s then.

1 Like

Feature request to support Cloudflare Workers at stripe-node's GitHub repo: