Skip to content

[2025-07] Money Component Incompatible with Customer Account API MoneyV2 (USDC Currency) #3089

@juanpprieto

Description

@juanpprieto

Which package or tool is having this issue?

hydrogen-react

What version of that package or tool are you using?

2025.5.0

What version of Remix are you using?

2.14.0

Steps to Reproduce

  1. Use the 2025-07 Storefront API and Customer Account API versions
  2. Fetch order data from Customer Account API that includes USDC currency amounts
  3. Pass the MoneyV2 data to the <Money> component from @shopify/hydrogen-react
  4. Run npm run typecheck in templates/skeleton
  5. Observe TypeScript errors in account order pages

Expected Behavior

The Money component should accept MoneyV2 data from both Storefront API and Customer Account API without TypeScript errors, regardless of currency code differences between the APIs.

Actual Behavior

TypeScript compilation fails with the following error:

Type 'Pick<MoneyV2, "amount" | "currencyCode">' is not assignable to type 'PartialObjectDeep<MoneyV2, { recurseIntoArrays: true; }>'.
  Types of property 'currencyCode' are incompatible.
    Type 'CurrencyCode' is not assignable to type 'CurrencyCode | undefined'.
      Type '"USDC"' is not assignable to type 'CurrencyCode | undefined'.

Additionally, when the TypeScript issue is resolved, rendering USDC amounts throws a runtime error:

RangeError: Invalid currency code : USDC

Root Cause

The 2025-07 API update added the "USDC" currency code to the Customer Account API's CurrencyCode enum but NOT to the Storefront API's CurrencyCode enum. This creates incompatible MoneyV2 types between the two APIs. Furthermore, the browser's Intl.NumberFormat API doesn't support cryptocurrency codes like USDC.

Additional Context

  • USDC (USD Coin) is a stablecoin cryptocurrency that maintains a 1:1 peg with USD
  • The Money component only accepts MoneyV2 from storefront-api-types
  • Intl.NumberFormat only recognizes ISO 4217 currency codes, not cryptocurrency codes
  • This blocks CI for any PR targeting branches with 2025-07 API update

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions