Stripe · sdk · fg-0154

stripe-node calls hang or bypass MSW and Nock 14 mocks in tests

If you see Stripe requests hang until timeout when MSW is active, the cause and the fix for Stripe are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Stripe requests hang until timeout when MSW is activeRequests reach the real Stripe API instead of the mock under nock 14
Cause
The default Node HTTP client defers ending the request in a way that @mswjs/interceptors, which MSW and nock 14 use, did not see. 23.0.0 fixed the client.
Fix
Upgrade to stripe-node 23, or switch the client to the fetch based HTTP client in tests.
Apply
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, { httpClient: Stripe.createFetchHttpClient() });
Affected
stripe-node before 23.0.0 with msw or nock 14; fixed in 23.0.0, 2026-09-30
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun