Skip to content

fix(sse): import localDb through its real .ts extension (#10674) - #10691

Merged
diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10674-localdb-js-import
Aug 18, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10674-localdb-js-import

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Closes #10674.

Root cause

open-sse/services/combo.ts:90 imported "../../src/lib/localDb.js" — a .js suffix on a
module that only ever existed as .ts. Turbopack resolved it by accident; the dependency-tree
change in #10647 stopped doing so, and the instrumentation hook then died at boot with
MODULE_NOT_FOUND.

Every sibling import in that same file already uses .ts, so this was a one-off slip, not a
convention.

Impact this was causing

Validation

Before/after on the tip (df90591415), fresh npm ci, .build/next/dev cache cleared:

result
before Fatal: instrumentation hook failed during boot: Cannot find module '../../src/lib/localDb.js'
after boots fully — migrations, schedulers, proxy-health all start; 0 Module not found

typecheck:core clean, eslint clean on all three files.

Second offender found by the guard

src/lib/usage/usageLedger.ts:1 had the same .js-on-a-.ts pattern. It never broke because
it is an import type, erased before resolution — a latent copy of the same bug, fixed here.

Guard

tests/unit/no-js-extension-on-repo-imports-10674.test.ts rejects relative .js specifiers
across open-sse/ and src/. Package specifiers stay allowed on purpose: publishing ESM under
.js is correct for real packages (@modelcontextprotocol/sdk/client/index.js and 25 others
in-tree). Proven to discriminate — re-introducing the .js suffix makes it fail, naming the
exact file and line.

`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in #10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes #10674
@diegosouzapw

Copy link
Copy Markdown
Owner Author

Merging with the inherited base-red documented. None of the 10 red checks come from this PR (diff = 2 import specifiers + 1 new guard test):

  • Docs Gates — stale counts across README/AGENTS/llm.txt/4 SVGs (153→154 migrations, 340→341 providers) after other merges landed.
  • Fast Quality Gates — open-sse/executors/index.ts TS2345, geminiWeb.ts size, and 4 stryker tap.testFiles entries missing for sse-auth-exclusive-leases, aihorde-optional-api-key and responses-passthrough-openai-compatible — all other people's tests, reproduced locally on this branch.
  • Unit Tests fast-path — Antigravity cloudcode envelope tests.
  • Fast Production Build — the very defect this PR partially fixes; it needs fix(config): keep the SQLite driver out of the client bundle (#10692) #10695 on top to go green (see that PR's build evidence).

Tracked under #9985.

@diegosouzapw
diegosouzapw merged commit 37c81ce into release/v3.8.50 Aug 18, 2026
10 checks passed
@diegosouzapw
diegosouzapw deleted the fix/10674-localdb-js-import branch August 18, 2026 22:23
HouMinXi pushed a commit to HouMinXi/OmniRoute that referenced this pull request Aug 20, 2026
…#10674) (diegosouzapw#10691)

`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in diegosouzapw#10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes diegosouzapw#10674

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
giauphan pushed a commit to giauphan/OmniRoute that referenced this pull request Aug 20, 2026
…#10674) (diegosouzapw#10691)

`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in diegosouzapw#10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes diegosouzapw#10674

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…#10674) (diegosouzapw#10691)

`open-sse/services/combo.ts` imported "../../src/lib/localDb.js" — a .js suffix
on a module that only exists as .ts. Turbopack resolved it by accident until the
dependency-tree change in diegosouzapw#10647; after that the instrumentation hook died at boot
with MODULE_NOT_FOUND, breaking `npm run dev` and the production build (60
consecutive red `Build App` runs on release/v3.8.50).

Fixes the same latent pattern in src/lib/usage/usageLedger.ts, which survived only
because it is an `import type` and is erased before resolution.

Adds a guard rejecting relative .js specifiers across open-sse/ and src/. Package
specifiers are untouched: publishing ESM as .js is legitimate there (e.g.
@modelcontextprotocol/sdk), and only first-party relative imports are first-party
TypeScript.

Closes diegosouzapw#10674

Co-authored-by: Xiangzhe <bakryun0718@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants