Skip to content

@thirdweb-dev/insight, engine, api, service-utils: CJS build requires tslib without listing it in dependencies #9070

Open

Description

@trackoor

The published CommonJS entrypoints ("default" export condition and "main") of @thirdweb-dev/insight, @thirdweb-dev/engine, @thirdweb-dev/api, and @thirdweb-dev/service-utils call require("tslib") at module load without listing tslib in dependencies.

cd "$(mktemp -d /tmp/repro-thirdweb.XXXXXX)" && npm init -y >/dev/null
npm install @thirdweb-dev/engine@3.4.0
node -e 'require("@thirdweb-dev/engine")'

Actual output (same MODULE_NOT_FOUND on @thirdweb-dev/insight@1.1.2, @thirdweb-dev/api@0.2.0, and @thirdweb-dev/service-utils@0.10.11, including /node and /cf-worker):

node:internal/modules/cjs/loader:1607
  throw err;
  ^

Error: Cannot find module 'tslib'
Require stack:
- /tmp/repro-thirdweb.APGaE8/node_modules/@thirdweb-dev/engine/dist/cjs/exports/thirdweb.js
- /tmp/repro-thirdweb.APGaE8/[eval]
    at Module._resolveFilename (node:internal/modules/cjs/loader:1603:15)
    at wrapResolveFilename (node:internal/modules/cjs/loader:1145:27)
    at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1169:10)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1196:12)
    at Module._load (node:internal/modules/cjs/loader:1370:5)
    at wrapModuleLoad (node:internal/modules/cjs/loader:261:19)
    at Module.require (node:internal/modules/cjs/loader:1713:12)
    at require (node:internal/modules/helpers:318:16)
    at Object.<anonymous> (/tmp/repro-thirdweb.APGaE8/node_modules/@thirdweb-dev/engine/dist/cjs/exports/thirdweb.js:4:17)
    at Module._compile (node:internal/modules/cjs/loader:1968:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/tmp/repro-thirdweb.APGaE8/node_modules/@thirdweb-dev/engine/dist/cjs/exports/thirdweb.js',
    '/tmp/repro-thirdweb.APGaE8/[eval]'
  ]
}

Node.js v26.13.0

Expected output: require(...) loads each package cleanly on a fresh install, matching the ESM "import" build.

Each package sets "importHelpers": true in tsconfig.base.json, so build:cjs (tsc ... --module commonjs) compiles export * re-exports to const tslib_1 = require("tslib"); tslib_1.__exportStar(...), while insight, engine, and api list tslib only in devDependencies and service-utils (as well as packages/thirdweb in dist/cjs/exports/{utils,bridge,engine,insight}.js, currently masked when transitive dependencies hoist tslib) omits tslib and builds with tsc --noCheck.

Versions: @thirdweb-dev/engine@3.4.0, @thirdweb-dev/insight@1.1.2, @thirdweb-dev/api@0.2.0, @thirdweb-dev/service-utils@0.10.11, thirdweb@5.122.1 (all npm latest), and main (940b374), Node.js v26.13.0, npm 11.20.0.

Credit: https://ucsbplse.github.io/

Activity

  1. linear commented on Nov 15, 2026

    @linear
  2. github-actions commented on Nov 23, 2026

    @github-actions
    Contributor

    This issue has been inactive for 7 days. It is now marked as stale and will be closed in 2 days if no further activity occurs.

  3. trackoor commented on Nov 23, 2026

    @trackoor
    Author

    It is being fixed, pending the merge #9071

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions