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
.mjs files detected but produce 0 nodes during extraction (incomplete fix for #365) #387
Issue #365 was closed as fixed in v0.4.15, but the fix is incomplete. .mjs files were added to CODE_EXTENSIONS in detect.py so they appear in corpus metrics, but were not added to the _DISPATCH table in extract.py. The extractor silently skips them, producing zero nodes and edges.
Users who upgraded to v0.4.15 expecting #365 to be resolved will see .mjs files counted in the detection summary but get no architectural insight from them.
Reproduction
frompathlibimportPathfromgraphify.detectimportCODE_EXTENSIONSfromgraphify.extractimportextractimporttempfiletmpdir=Path(tempfile.mkdtemp())
mjs=tmpdir/"app.mjs"mjs.write_text('export function hello() { return "world"; }')
print(".mjs in CODE_EXTENSIONS:", ".mjs"inCODE_EXTENSIONS) # Trueresult=extract([mjs], cache_root=tmpdir)
print("Nodes:", len(result["nodes"])) # 0 — should be >= 2print("Edges:", len(result["edges"])) # 0
The extraction loop at line 3109 does extractor = _DISPATCH.get(path.suffix) which returns None, then continue at line 3111 silently skips the file.
PR #372 (which included the _DISPATCH addition) was closed without merge. The direct fix applied to v0.4.15 updated detect.py but missed extract.py.
Fix
Add ".mjs": extract_js to the _DISPATCH dict in extract(). .mjs is standard ES module JavaScript and should be parsed identically to .js by tree-sitter-javascript.
Note: .ejs was also added to CODE_EXTENSIONS and has the same dispatch gap. EJS is an HTML templating engine — it may be better suited to DOC_EXTENSIONS for semantic extraction rather than AST parsing. Happy to discuss the right approach.
Activity
safishamsi commentedon Apr 16, 2026
Fixed in v0.4.16.
pip install --upgrade graphifyy