Fix export for Stripe.Decimal in CJS and ESM#2626
Merged
prathmesh-stripe merged 1 commit intomasterfrom Mar 26, 2026
Merged
Conversation
mbroshi-stripe
approved these changes
Mar 26, 2026
8e6fae0 to
38ebe1a
Compare
38ebe1a to
329a188
Compare
mbroshi-stripe
approved these changes
Mar 26, 2026
Contributor
mbroshi-stripe
left a comment
There was a problem hiding this comment.
Looks good! Thanks for adding the integration test!
jar-stripe
added a commit
that referenced
this pull request
Mar 27, 2026
The Decimal class was accessible as a runtime value via Stripe.Decimal (after #2626), but could not be used as a TypeScript type annotation. Writing `const d: Stripe.Decimal = Stripe.Decimal.from('1.0')` produced TS2749: "'Stripe.Decimal' refers to a value, but is being used as a type here." This adds Decimal to the Stripe namespace as a type in three places: - stripe.core.ts (shared namespace definition) - stripe.esm.node.ts (namespace + named module export) - stripe.cjs.node.ts (namespace on the CJS export wrapper) After this change, all of these work: - ESM: `const d: Stripe.Decimal = Stripe.Decimal.from('1.0')` - ESM: `import { Decimal } from 'stripe'` (named import) - CJS: `const d: Stripe.Decimal = Stripe.Decimal.from('1.0')` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Committed-By-Agent: claude
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
User reported an issue where they were unable to access
Stripe.Decimalin the Node SDK while using TypeScript and ESM import.Decimal class wasn't exported correctly and this is a problem with both CJS and ESM style of imports.
What?
See Also
#2625
Changelog