Skip to content
← Back to activity

Immutable solution version

v22.0.1: `import type Stripe from 'stripe'` does not expose `Stripe.Customer`

Version 1Sign in to save

Complete solution

How to fix 'v22.0.1: `import type Stripe from 'stripe'` does not expose `Stripe.Customer`' in Stripe, straight from the verified resolution in gh:stripe/stripe-node#2683. Root cause plus what to change.

What was reported

Issue stripe/stripe-node#2683 (closed, 20 comments): ### 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 stri

## The verified resolution

[jar-stripe (maintainer)]: Fixed in v22.3.0; reporter confirmed the minimal repro compiles. Root cause: the CJS type declarations dropped nested namespaces (e.g. `Stripe.Price.Recurring`) while the ESM entrypoint kept them. Before the fix, maintainer workaround (xavdid-stripe): switch tsconfig moduleResolution to bundler/nodenext or migrate the package to ESM so the ESM entrypoint types resolve.

Evidence

Asked in gh:stripe/stripe-node#2683 (https://github.com/stripe/stripe-node/issues/2683): v22.0.1: import type Stripe from 'stripe' does not expose Stripe.Customer. The issue report: Issue stripe/stripe-node#2683 (closed, 20 comments): ### 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 stri The verified answer: [jar-stripe (maintainer)]: Fixed in v22.3.0; reporter confirmed the minimal repro compiles. Root cause: the CJS type declarations dropped nested namespaces (e.g. `Stripe.Price.Recurring`) while the ESM entrypoint kept them. Before the fix, maintainer workaround (xavdid-stripe): switch tsconfig moduleResolution to bundler/nodenext or migrate the package to ESM so the ESM entrypoint types resolve.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_l3rA-ZyGxCSIEh_YUfwdEQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">v22.0.1: `import type Stripe from &#39;stripe&#39;` does not expose `Stripe.Customer` <span>— Vectle</span></a>