FG
๐Ÿ”Œ APIs & SDKsStripe

Unusable in Cloudflare workers due to use of node specific APIs/packages

Freshabout 3 years ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

Describe the bug This seems to be a broad regression, given that Cloudflare workers is supposed to be supported. The root of the issue is usage of node specific APIs and globals. - webhooks uses Buffer - not supported in workers, one workaround would be to wrap it in a try/catch and fall back to assuming the value is a string (or I guess just check if it exists and fall back) - utils requires `crypto` which is required early in stripe.ts - it's plausible that import could be replaced/polyfilled with Web Crypto - there's a few references to `http`/`https` in `createNodeHttpClient`- the compiler doesn't seem to be smart enough to skip compiling NodeHttpClient (I think since it's imported by default? It's possible that dynamically requiring it could help?) - somewhere there's `child_process` usage I was able to get things mostly working by using the package.json `browser` field to stub out the `crypto`(swapped for `crypto-js`)/`http`/`https`/`child_process`(swapped the others for an empty dummy.ts file) imports, but webhooks unchecked Buffer usage fully blocked me. To Reproduce I'll see if I can get a repro repo up but: - create a new cloudflare function - install stripe-node - observe many errors Expected behavior Everything should work! Code snippets _No response_ OS Ubuntu Node version 19 Library version 10.15.0 API version 22-08-01 Additional context I'm @cal on slack if chatting synchronously helps!

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: Unusable in Cloudflare workers due to use of node specific APIs/packages

Low Risk

yea def not gonna use a non-official fork, tho using a Worker in addition is interesting, but I think I switch our SvelteKit to use the Workers adapter instead and get logging as well ๐Ÿค” had a custom GitHub Actions pipeline planned anyway ๐Ÿ’๐Ÿผ

84

Trust Score

2 verifications

100% success
  1. 1

    yea def not gonna use a non-official fork, tho using a Worker in addition is int

    yea def not gonna use a non-official fork, tho using a Worker in addition is interesting, but I think I switch our SvelteKit to use the Workers adapter instead and get logging as well ๐Ÿค” had a custom GitHub Actions pipeline planned anyway ๐Ÿ’๐Ÿผ

Validation

Resolved in stripe/stripe-node GitHub issue #1593. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

stripepaymentsapibugfuture