Describe the bug
stripe@22.0.1 appears to fix the CommonJS constructor regression from #2660.
However, there seems to be a separate TypeScript issue specifically with type-only default imports:
import type Stripe from 'stripe';
let customer: Stripe.Customer; // TS2694: Namespace 'StripeConstructor' has no exported member 'Customer'
In contrast, the standard documented usage continues to work.
import Stripe from 'stripe';
const stripe = new Stripe('your_stripe_secret_key', {
apiVersion: '2026-03-25.dahlia',
});
async function createCustomer() {
return await stripe.customers.create({
email: '',
});
}
So this does not appear to be a general regression in namespaced Stripe types.
It appears to be specifically about import type Stripe from 'stripe'.
To Reproduce
- Create a TypeScript project with
module: "commonjs", moduleResolution: "node", esModuleInterop: true
- Install stripe@22.0.1
- Use:
import type Stripe from 'stripe';
let customer: Stripe.Customer;
- Run tsc
Expected behavior
Either
import type Stripe from 'stripe' should support references like Stripe.Customer
- the migration guide / README should document that this pattern is no longer supported and recommend the replacement pattern.
Code snippets
OS
WSL2 (Debian) on Windows 11
Node version
Node v22.22.2
Library version
stripe@22.0.1
API version
2026-03-25.dahlia
Additional context
The v22 migration guide documents breaking changes to exported TypeScript types, but it does not mention import type Stripe from 'stripe' as a changed or unsupported pattern. It documents other typing changes such as:
-
removal of the old types/ directory
-
Stripe.StripeContext -> StripeContextType
-
changed type usage for Stripe.errors.StripeError
-
Related reports:
-
I am not sure whether these are exactly the same root cause, but they appear closely related.
Describe the bug
stripe@22.0.1appears to fix the CommonJS constructor regression from #2660.However, there seems to be a separate TypeScript issue specifically with type-only default imports:
In contrast, the standard documented usage continues to work.
So this does not appear to be a general regression in namespaced Stripe types.
It appears to be specifically about
import type Stripe from 'stripe'.To Reproduce
module: "commonjs",moduleResolution: "node",esModuleInterop: trueExpected behavior
Either
import type Stripe from 'stripe'should support references likeStripe.CustomerCode snippets
OS
WSL2 (Debian) on Windows 11
Node version
Node v22.22.2
Library version
stripe@22.0.1
API version
2026-03-25.dahlia
Additional context
The v22 migration guide documents breaking changes to exported TypeScript types, but it does not mention import type Stripe from 'stripe' as a changed or unsupported pattern. It documents other typing changes such as:
removal of the old types/ directory
Stripe.StripeContext->StripeContextTypechanged type usage for
Stripe.errors.StripeErrorRelated reports:
import type Stripe from 'stripe'/Stripe.CustomerStripe.Checkout.SessionCreateParamsI am not sure whether these are exactly the same root cause, but they appear closely related.