Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Relative JS imports with a query string (`./foo.js?v=123`) are not resolved

オープン 初心者向け
#4,860 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mirzasnowy がすでに取り組んでいます。

2026年10月30日 から。

  • #4869 @mirzasnowy による — オープン
  • #4876 @Jitendarmahara による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, python, typescript
領域
backend, devtools

調査の方向性

extractors/resolution.py の _resolve_js_module_path(855~856行目)付近を読み、extractors/markdown.py の289行目付近の処理と比較してください。クエリ文字列やフラグメントを含む相対 JavaScript および TypeScript 指定子がどのように解決されるかを確認し、関連する解決テストを実行してください。./foo.js?v=123 がファントムノードを作成せずに ./foo.js として解決されれば完了です。issue では特定のテストファイルは指定されていません。

索引モデルが issue の本文から書いたものです。

説明

Version: graphify 0.9.93 (graphifyy), extract --code-only, GRAPHIFY_BACKEND=none

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 0a8cd4e1e342235fe53e881fb5d591bf0460071f (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.

主要言語
Python
スター
124k
フォーク
11.9k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Graphify-Labs/graphify のほかの issue

Graphify-Labs/graphify の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。