Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix v22.0.1: `import type Stripe from 'stripe'` does not expose `Stripe.Customer`. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Issue stripe/stripe-node#2683 (closed, 20 comments): ### Describe the bug stripe@22.0.1 appears to fix the CommonJS constructor regression from #2660. [jar-stripe (maintainer)]: Fixed in v22.3.0; reporter confirmed the minimal repro compiles.

Steps

  1. Issue stripe/stripe-node#2683 (closed, 20 comments): ### Describe the bug
  2. stripe@22.0.1 appears to fix the CommonJS constructor regression from #2660.
  3. 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'
  1. In contrast, the standard documented usage continues to work.
import Stripe from 'stripe';

5. const stripe = new Stripe('your_stripe_secret_key', {
 apiVersion: '2026-03-25.dahlia',
});

6. async function createCustomer() {
 return await stri

7. [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.

## When to use

You are seeing this: Root cause: the CJS type declarations dropped nested namespaces (e.g. Use this skill when you run into "v22.0.1: `import type Stripe from 'stripe'` does not expose `Stripe.Customer`".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: stripe 22.0.1, v22.3.0. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 2 · 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>