You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
imports to a file absent from the scan (e.g. gitignored codegen) emit abs-path slug endpoints (residual of #2262) #2457
Follow-on to #2262. That report's .tsx-handler calls case was fixed in 0.9.30, but the import-edge residual I flagged in a follow-up comment (before the issue was closed) is still present on 0.9.32. Filing it separately with a minimal repro since it is a distinct code path.
Bug
When a TS/JS file imports from a module that is not present in the scanned tree (e.g. a gitignored codegen output), the imports and imports_from edges get absolute-path-derived slug endpoints instead of a stable identifier. The slug is machine-specific and differs per checkout path, so committed graphs churn on every rebuild from a different location, the same reproducibility problem as #2262 and #2273.
Repro (minimal, deterministic on 0.9.32)
proj/tsconfig.json
proj/src/consumer.ts -> import { getFoo } from "./generated/api";
export function run(): number { return getFoo(); }
Both endpoints are the absolute scan path slugified, for a module and symbol that are not on disk.
Scale
On a real TS monorepo (~75k nodes), this produced ~6,700 such endpoints (4,138 imports, 2,510 imports_from, plus a few references/re_exports), almost all imports to a gitignored generated GraphQL client. It is the dominant reason that graph fails a fail-closed host-path check.
Suggested fix
For an import target that resolves to no node (an absent file), emit a repo-relative stable identifier or drop the edge, rather than an absolute-path-derived slug. The general backstop that canonicalizes node-less absolute-derived endpoints elsewhere does not cover the imports/imports_from path.
Confirmed this still reproduces on 0.9.36. This one is the dominant blocker for us: on a real TS monorepo it accounts for ~6,700 abs-path slug endpoints, which fails a fail-closed host-path check and keeps that graph out of commit. Happy to test a patch or share more of the real graph if it helps.
Still reproduces on graphify 0.9.38. The minimal repro (a TS file importing from a module absent from the scan, e.g. gitignored codegen output) still emits absolute-path slug endpoints for both import edges:
At scale on a real TS monorepo (~82k nodes, ~52k ts/tsx), 6,609 such endpoints remain (imports 4,053, imports_from 2,476, references 64, re_exports 16), almost all imports to a gitignored generated GraphQL client. Consistent with the ~6,731 seen on 0.9.32, so no change.
I reproduced this on current v8: an unresolved relative TypeScript import still emits absolute-path-derived imports and imports_from targets. I’m adding a regression test for the missing generated-module case, then will keep unresolved local imports on a stable external reference path so checkout paths cannot leak into the graph.
Fixed in v0.9.41 (graphifyy==0.9.41 on PyPI). An unresolved local JS/TS import (to a file absent from the scan) now emits a stable, portable ref_* target id instead of leaking a per-checkout absolute-path slug. Thanks @rohit-jsfreaky (PR #2645).
This is not fully fixed in 0.9.41 - could you reopen? It fixes plain import ... from an absent/gitignored module (verified: those edges now resolve to ref_* ids). But three other code paths that hit the same unresolved-absent-file resolution still emit the per-checkout absolute-path slug instead of a ref_* id. On a real TS monorepo (~82k nodes) this leaves 314 abs-path-slug endpoints, down from ~6,609 on 0.9.38.
1. re_exports edges (verified minimal repro on 0.9.41)
export { X } from "./absent" still leaks. Minimal:
proj/src/reexport.ts -> export { getFoo } from "./generated/api";
(proj/src/generated/api.ts is absent)
The imports_from half now resolves to ref_, but the paired re_exports edge does not. Same file category as the fixed import case. 6 such leaks in the real repo (e.g. Packages/file-management/src/index.ts, Packages/insights/test/mocks/MockData.ts re-exporting the gitignored generated GraphQL client).
2. CommonJS require()
Unresolved require("./oop") / require("../lib/event") still leaks the abs-path slug (both imports and imports_from). 244 leaks in the real repo, all in two vendored bundles (LegacyPageScripts/src/Vendor/ace/ace.js, .../Vendor/ace-12/ace.js) that require sibling files absent from the checkout.
3. Markdown references
Doc-to-doc cross-references to absent paths use a separate extraction path and still emit abs-path slugs. 64 leaks (e.g. Apps/storybook/.ai/instructions.md). Likely outside the strict JS/TS import scope; flagging for completeness.
Extending the same ref_* resolution to re_exports and require() (and optionally the markdown reference path) would close the remaining 314.
Activity
vanjos commentedon Aug 10, 2026
Confirmed this still reproduces on 0.9.36. This one is the dominant blocker for us: on a real TS monorepo it accounts for ~6,700 abs-path slug endpoints, which fails a fail-closed host-path check and keeps that graph out of commit. Happy to test a patch or share more of the real graph if it helps.
vanjos commentedon Aug 11, 2026
Still reproduces on graphify 0.9.38. The minimal repro (a TS file importing from a module absent from the scan, e.g. gitignored codegen output) still emits absolute-path slug endpoints for both import edges:
At scale on a real TS monorepo (~82k nodes, ~52k ts/tsx), 6,609 such endpoints remain (imports 4,053, imports_from 2,476, references 64, re_exports 16), almost all imports to a gitignored generated GraphQL client. Consistent with the ~6,731 seen on 0.9.32, so no change.
rohit-jsfreaky commentedon Aug 11, 2026
I reproduced this on current
v8: an unresolved relative TypeScript import still emits absolute-path-derivedimportsandimports_fromtargets. I’m adding a regression test for the missing generated-module case, then will keep unresolved local imports on a stable external reference path so checkout paths cannot leak into the graph.fix(js): stabilize unresolved local import target ids (#2457)
docs(changelog): add #2663/#2601/#2661/#2457/#2674 to the 0.9.41 section
safishamsi commentedon Aug 12, 2026
Fixed in v0.9.41 (
graphifyy==0.9.41on PyPI). An unresolved local JS/TS import (to a file absent from the scan) now emits a stable, portableref_*target id instead of leaking a per-checkout absolute-path slug. Thanks @rohit-jsfreaky (PR #2645).vanjos commentedon Aug 12, 2026
This is not fully fixed in 0.9.41 - could you reopen? It fixes plain
import ... froman absent/gitignored module (verified: those edges now resolve toref_*ids). But three other code paths that hit the same unresolved-absent-file resolution still emit the per-checkout absolute-path slug instead of aref_*id. On a real TS monorepo (~82k nodes) this leaves 314 abs-path-slug endpoints, down from ~6,609 on 0.9.38.1.
re_exportsedges (verified minimal repro on 0.9.41)export { X } from "./absent"still leaks. Minimal:yields:
The
imports_fromhalf now resolves toref_, but the pairedre_exportsedge does not. Same file category as the fixedimportcase. 6 such leaks in the real repo (e.g.Packages/file-management/src/index.ts,Packages/insights/test/mocks/MockData.tsre-exporting the gitignored generated GraphQL client).2. CommonJS
require()Unresolved
require("./oop")/require("../lib/event")still leaks the abs-path slug (bothimportsandimports_from). 244 leaks in the real repo, all in two vendored bundles (LegacyPageScripts/src/Vendor/ace/ace.js,.../Vendor/ace-12/ace.js) that require sibling files absent from the checkout.3. Markdown
referencesDoc-to-doc cross-references to absent paths use a separate extraction path and still emit abs-path slugs. 64 leaks (e.g.
Apps/storybook/.ai/instructions.md). Likely outside the strict JS/TS import scope; flagging for completeness.Extending the same
ref_*resolution tore_exportsandrequire()(and optionally the markdown reference path) would close the remaining 314.fix(js): keep unresolved require() targets out of the checkout path