Skip to content

Published module is broken: it's a CJS module instead of ESM #424

@jeremv42

Description

@jeremv42

Environment

  • Checkout SDK version: 3.1.0
  • Platform and version: Node 24.13.1
  • Operating System and version: MacOS 26.3 (25D125)

Description

Recently published SDK 3.1.0 is broken: it says that it's an ESM module but it's CJS, previous version (3.0.3) was fine.

Expected behavior

Correct ESM module

Current behavior

import { Checkout } from 'checkout-sdk-node';
         ^
SyntaxError: The requested module 'checkout-sdk-node' does not provide an export named 'Checkout'
    at #asyncInstantiate (node:internal/modules/esm/module_job:319:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:422:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:661:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Steps to reproduce

Import the SDK in a ESM module

Possible solution

  • Revert publish commands to 3.0.3 (it was ok)
    or
  • remove "type": "module" from package.json but I think that it's a regression

Additional information

Metadata

Metadata

Assignees

No one assigned

    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