Repository navigation
fix(sse): import localDb through its real .ts extension (#10674) - #10691
Merged
Merged
Conversation
`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
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):
Tracked under #9985. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10674.
Root cause
open-sse/services/combo.ts:90imported"../../src/lib/localDb.js"— a.jssuffix on amodule that only ever existed as
.ts. Turbopack resolved it by accident; the dependency-treechange 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 aconvention.
Impact this was causing
npm run devon the tip could not boot at all (the symptom base-red: dev server cannot boot on release/v3.8.50 tip — instrumentation fails with "Cannot find module '../../src/lib/localDb.js'" after #10647's lockfile change #10674 reports).Build Apphas been red for 60 consecutive runs onrelease/v3.8.50— every runavailable through the API, none green. The failure cascades: once
combo.tsfails toresolve, Next reports 29
Module not founderrors, including Node builtins(
child_process,dns,fs,tls,net,module) pulled into the Middleware/Instrumentationgraphs. All 29 come from this single unresolved import.
Deploy to VPShas been skipping as a consequence.Validation
Before/after on the tip (
df90591415), freshnpm ci,.build/next/devcache cleared:Fatal: instrumentation hook failed during boot: Cannot find module '../../src/lib/localDb.js'Module not foundtypecheck:coreclean,eslintclean on all three files.Second offender found by the guard
src/lib/usage/usageLedger.ts:1had the same.js-on-a-.tspattern. It never broke becauseit 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.tsrejects relative.jsspecifiersacross
open-sse/andsrc/. Package specifiers stay allowed on purpose: publishing ESM under.jsis correct for real packages (@modelcontextprotocol/sdk/client/index.jsand 25 othersin-tree). Proven to discriminate — re-introducing the
.jssuffix makes it fail, naming theexact file and line.