Skip to content

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

Description

@seigo2016

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

  1. Create a TypeScript project with
  • module: "commonjs", moduleResolution: "node", esModuleInterop: true
  1. Install stripe@22.0.1
  2. Use:
import type Stripe from 'stripe';
let customer: Stripe.Customer;
  1. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions