Skip to content

[BUG] Typescript SDK: ESM import error for native ESM #3613

@Spid3rrr

Description

@Spid3rrr

Describe the issue
The TypeScript SDK docs example uses @hatchet-dev/typescript-sdk/v1, but in native Node ESM this throws ERR_UNSUPPORTED_DIR_IMPORT at runtime. Node suggests @hatchet-dev/typescript-sdk/v1/index.js instead. This makes the documented import path incorrect or incomplete for ESM users.

Environment

  • SDK: @hatchet-dev/typescript-sdk 1.21.0
  • Runtime: Node.js 24.14.1 (native ESM, type: "module")
  • Engine: Cloud - latest

Expected behavior
The documented import path @hatchet-dev/typescript-sdk/v1 should work in ESM projects, or docs should explicitly mention the ESM-safe import path if different.

Code to Reproduce, Logs, or Screenshots
Repro repo: repo

Error observed at runtime: ERR_UNSUPPORTED_DIR_IMPORT for @hatchet-dev/typescript-sdk/v1 in native ESM.

Additional context
Behavior differs between module systems: CommonJS can resolve it, while native ESM cannot.

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