Skip to content

The JavaScript SDK has never compiled: 48 tsc errors, and CI never runs the build #314

Closed

Description

@scttfrdmn

npm run build in sdks/javascript fails with 48 tsc errors. Verified by copying package.json, tsconfig.json and src/ to a scratch directory, npm install, npx tsc --noEmit.

Two of the 48 are not strictness nits — they are references to things that do not exist:

  • src/types.ts:308 — config?: Configuration | ... in ClientOptions. There is no Configuration type anywhere in src/. The only near match is ConfigurationPreset (types.ts:316). error TS2304: Cannot find name 'Configuration'.
  • src/index.ts:32 — export { StorageAdapter } from './storage'. storage.ts exports S3StorageAdapter and nothing named StorageAdapter. error TS2724.

Both date to bf9c916 ("feat: Complete language-specific SDK development", 2025-08-18), the commit that added the SDK. So the published main field points at dist/index.js, and dist/ has never been producible from this source.

The remaining 46 are real too, mostly exactOptionalPropertyTypes: true and noUncheckedIndexedAccess: true violations the tsconfig turns on and the source does not honour: 11×TS2739 and 5×TS2741 (missing required properties, all in config.ts's preset objects), 9×TS2322, 6×TS18048 ('result' is possibly 'undefined' in monitoring.ts), plus mount.ts:68,76 Property 'on' does not exist on type 'never' — the ChildProcess overload intersection reduced to never.

Why CI is green

Nothing in CI or the Makefile runs tsc:

$ grep -rn 'npm run build\|npm run docs\|tsc' .github/workflows/ Makefile
.github/workflows/ci.yml:304:  # tsconfig.json excludes **/*.test.ts from the build.

sdk-metrics (ci.yml:299-306) runs npm install && npm test. npm test is jest, and ts-jest typechecks only the files the suite pulls in — prometheus.test.ts and prometheus.ts. prometheus.ts happens to be clean. Every other file in the SDK is unchecked by anything.

Related: the TypeScript version is silently pinned three minors back

devDependencies says typescript: ^5.0.0, but the resolved compiler is 5.1.6, because typedoc@^0.24.0 declares peer typescript@"4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x". The SDK is being compiled by a 2023 compiler while the manifest suggests current 5.x.

This is also the third package in the peer-coupled set from #306, which was missed there. Grouping typescript+ts-jest+jest+@types/jest is not sufficient — typedoc gates the same range. Verified resolution ceiling today:

package latest peer range on typescript
ts-jest 29.4.12 >=4.3 <7
typedoc 0.28.20 5.0.x ... 5.9.x || 6.0.x

So TypeScript 7 is not installable here at any grouping — #308's typescript@^7.0.2 fails npm install even with jest/@types/jest moved to 30, because ts-jest has no <8 release. The reachable target is TypeScript 6, with typedoc bumped ^0.24.0 → ^0.28.20. Verified: that four-package set resolves cleanly (npm install --dry-run clean).

TypeScript 6 then adds one more error on top of the 48: tsconfig.json:15 moduleResolution: "node" is error TS5107 — deprecated, removed in 7.0, needs "ignoreDeprecations": "6.0" or a move to node16/nodenext. Switching to node16 does not reduce the other 48.

Proposed order

  1. Fix the two nonexistent-identifier errors (Configuration, StorageAdapter) — these are wrong regardless of compiler version.
  2. Fix or explicitly relax the strictness errors. exactOptionalPropertyTypes and noUncheckedIndexedAccess are good settings; the honest options are to satisfy them or to turn them off, not to leave them on and unenforced.
  3. Add npm run build to the sdk-metrics job, so this cannot regress silently. Without this step the other two fixes have no guard.
  4. Only then bump the toolchain: typescript ^6, typedoc ^0.28, jest ^30, @types/jest ^30, and moduleResolution.
  5. Add typedoc to the typescript-toolchain group in .github/dependabot.yml, and close deps(deps-dev): bump the typescript-toolchain group in /sdks/javascript with 3 updates #308 as unresolvable at TypeScript 7.

Filed while investigating #308's ERESOLVE; the install failure is real but it was masking a larger one.

Activity

  1. added
    type: bug
    priority: high
    area: sdk
    area: ci-cd
    on Aug 3, 2026
  2. scttfrdmn commented on Aug 3, 2026

    @scttfrdmn
    OwnerAuthor

    A fourth never-run target in this same SDK, found while evaluating #309 (the typescript-eslint group bump): npm run lint has never worked either, and for a reason independent of the 48 tsc errors.

    package.json:96-116 carries an eslintConfig block whose extends reads:

    "extends": ["eslint:recommended", "@typescript-eslint/recommended", "prettier"]

    The correct name is plugin:@typescript-eslint/recommended. Without the plugin: prefix eslint resolves it as a shareable-config package, doesn't find one, and refuses to run at all. Verified against the currently pinned versions — a clean install of sdks/javascript at [email protected] and @typescript-eslint/*@5.62.0, i.e. exactly what main declares today:

    $ npx eslint "src/**/*.ts"
    Oops! Something went wrong! :(
    ESLint: 8.57.1
    ESLint couldn't find the config "@typescript-eslint/recommended" to extend from.
    The config "@typescript-eslint/recommended" was referenced from the config file in ".../package.json"
    

    "prettier" in the same list is likely wrong too — that resolves to eslint-config-prettier, which is declared, so it may be fine, but nothing has ever exercised it to find out.

    Same root cause as this issue: nothing in CI runs npm run lint. grep -rn "npm run lint\|eslint" .github/workflows/ returns zero hits. The sdk-metrics job runs npm install && npm test only, so a lint script that cannot start looks identical to one that passes.

    This matters for the fix order here. Step 3 of the plan above adds npm run build to sdk-metrics; npm run lint should go in the same commit, because otherwise the next person to add it discovers this separately. And it changes how #309 should be read: that PR bumps eslint 8 → 10, and eslint 9 removed .eslintrc-style config entirely in favour of flat eslint.config.js. So #309 needs a config rewrite — but it is not a regression, because there is no working lint today to regress. Whoever does step 3 should write the flat config once, at eslint 10, rather than fixing the plugin: prefix in a format that is already two majors obsolete.

  3. scttfrdmn commented on Aug 3, 2026

    @scttfrdmn
    OwnerAuthor

    Closed, but two of its five proposed steps were not in the closing work, and with the issue closed they were tracked nowhere:

    Steps 1-3 landed in #327, which also closes the CI gap this issue identified: npm run build and npm run lint now run as their own steps, so a bump that breaks compilation fails the PR instead of merging green. The same gap was then found and closed in the Python, Java and C SDKs by going looking for it.

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

    area: ci-cdarea: sdkpriority: hightype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions