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
Relative JS imports with a query string (./foo.js?v=123) are not resolved #4860
Description
ES module imports that include a cache-busting query string are not resolved to the target file:
import{foo}from'./lib/foo.js?v=134';
Instead of an imports_from edge to lib/foo.js, graphify creates a phantom node (e.g. ref_foo_js_v_134) and the real file gets no inbound edge. Symbol imports and cross-file calls are lost as well, since they depend on the module resolving.
Impact (real project, 93 JS files)
Phantom _v_ nodes: 96 → 0 after stripping the suffix
Inbound imports_from edges for the most-used module: 0 → 29
Symbol imports: 30 → 413
About 400 cross-file calls edges recovered
Root cause extractors/resolution.py, lines 855-856 (_resolve_js_module_path): relative specifiers are resolved with start_dir / raw without stripping the ?query / #fragment part. The Markdown extractor already strips it (extractors/markdown.py:289), so applying the same normalization to relative JS/TS specifiers should fix it.
Also present on v8 (default branch) as of 0a8cd4e (resolution.py lines 868-869).
Current workaround
Copy the tree to a temp dir, strip the suffix with sed -E 's/(\.js)\?v=[0-9]+/\1/g', and extract from the copy.
Expected behavior ./foo.js?v=123 resolves to ./foo.js, as browsers and bundlers do for module resolution.
Related:#2849 lists one ../styles.css?url import under "Resource-query import is unresolved". It looks like the same root cause.
Hi, I'd like to pick this up. Plan is pretty simple: strip the ?query and #fragment suffix off relative JS/TS specifiers before resolving, in _resolve_js_module_path, so a Vite-style import lands on the real file instead of minting a phantom node. Hash subpath imports, bare specifiers, and aliases stay untouched, and I'll add tests per specifier shape.
Hi! I'd like to work on this issue. I’ll investigate the JavaScript/TypeScript module resolution logic, add regression tests for imports containing query strings and URL fragments, and submit a fix while ensuring existing import resolution continues to work.
Activity
github-actions commentedon Oct 29, 2026
Thanks for opening this issue, @urieeluscanga-del. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
mirzasnowy commentedon Oct 29, 2026
Hi, I'd like to pick this up. Plan is pretty simple: strip the ?query and #fragment suffix off relative JS/TS specifiers before resolving, in _resolve_js_module_path, so a Vite-style import lands on the real file instead of minting a phantom node. Hash subpath imports, bare specifiers, and aliases stay untouched, and I'll add tests per specifier shape.
AdapaRohith commentedon Oct 29, 2026
Hi! I'd like to work on this issue. I’ll investigate the JavaScript/TypeScript module resolution logic, add regression tests for imports containing query strings and URL fragments, and submit a fix while ensuring existing import resolution continues to work.
style(extract): trim inline comments on the Graphify-Labs#4860 import…
style(extract): trim inline comments on the #4860 import fix
fix(extract): resolve relative JS/TS imports with a ?query or #fragment