Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Resolve NodeNext TypeScript `.js` imports to TypeScript source files

Open Beginner friendly
#100 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, typescript

Research direction

Start in CoderMind/scripts/rpg/dep_graph.py at the resolver and invoke-resolution ranges cited in the issue, then read the extensionless TypeScript invoke test in CoderMind/tests/test_multilingual_dep_graph.py. Add a NodeNext-style test using the provided a.ts and b.ts repro; done means the .js import resolves to b.ts and both cross-file import and invoke edges are present.

Written by the indexing model from the issue text.

Description

In a NodeNext/ESM TypeScript repo, relative imports such as import { b } from "./b.js" (the TypeScript-mandated form) remain unresolved, so the graph misses cross-file import and invoke edges. The resolver tries only the literal path when a specifier has an extension, so ./b.js is never tried as b.ts (resolver: https://github.com/microsoft/RPG-ZeroRepo/blob/f0947723cc07fe10fb0d6b14c8aa837847f57b0d/CoderMind/scripts/rpg/dep_graph.py#L2154-L2172 and invoke resolution: https://github.com/microsoft/RPG-ZeroRepo/blob/f0947723cc07fe10fb0d6b14c8aa837847f57b0d/CoderMind/scripts/rpg/dep_graph.py#L2225-L2239).

Minimal resolver-derived repro (not run):

repo/
  tsconfig.json
  src/a.ts
  src/b.ts

tsconfig.json: {"compilerOptions":{"module":"NodeNext","moduleResolution":"NodeNext"}}
src/a.ts: import { b } from "./b.js"; export function a() { return b(); }
src/b.ts: export function b() { return 1; }

Expected: import and invoke edges from src/a.ts to src/b.ts and from src/a.ts:a to src/b.ts:b. Actual: unresolved import and no cross-file invoke edge, as derived from reading the resolver, not from a run.

Suggested change:

         if extension:
             candidates.append(raw_path)
+            if extension in {".js", ".jsx", ".mjs", ".cjs"}:
+                stem = raw_path[:-len(extension)]
+                candidates.extend(
+                    f"{stem}{ext}" for ext in (".ts", ".tsx", ".mts", ".cts")
+                )

Please add a NodeNext-style test next to the existing extensionless TypeScript invoke test (https://github.com/microsoft/RPG-ZeroRepo/blob/f0947723cc07fe10fb0d6b14c8aa837847f57b0d/CoderMind/tests/test_multilingual_dep_graph.py#L156-L199). The audit report counted 241 relative .js imports as unresolved in the inspected repo. I can open a PR with the small resolver fix and test if useful.

This issue was AI-generated at the human operator's direction and reviewed by the operator before submission.

Dominant language
Python
Stars
553
Forks
43
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/RPG-ZeroRepo

All issues in microsoft/RPG-ZeroRepo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.