Skip to content

TT-025: Node SDK can't be loaded with CommonJS require() (ERR_PACKAGE_PATH_NOT_EXPORTED; exports has only an import condition) #856

Open

Description

@unjica

Found by QA (2026-10-21, reproduced 2/2). Refs #854 (that one only covers documentation).

Package: @telemetry-tracker/[email protected] from npm, Node v20.19.2, clean directory.

Steps

  1. npm init -y && npm i @telemetry-tracker/[email protected]
  2. node -e "require('@telemetry-tracker/node')"

Actual: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in .../@telemetry-tracker/node/package.json. The package exports is {".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}}, so there's no require/default condition and CommonJS apps (plain Node scripts, CJS Express apps, older tooling) can't load the SDK at all. ESM import works and exposes flush, trackError, etc.

Expected: Either ship a CJS build ("require" condition, or a "default" condition that Node can load), or declare ESM-only explicitly (README/docs plus a clear error message) so #854's docs can point to the supported path (e.g. await import()).

Acceptance: require('@telemetry-tracker/node') works on the published package, or ESM-only is documented and #854 gives a verified CJS workaround.

Activity

  1. added
    bug
    sdk
    qa
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugqasdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions