microsoft / microsoft/TypeScript
Module resolution should not look for node_modules outside project roots
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Currently, module resolution looks for node_modules all the way to the root of the filesystem. However, this is slow for certain virtual filesystems, like the one used in vscode-web, which maps only a part of the file system to in-memory files and the rest to web requests. https://github.com/microsoft/vscode/pull/173591 shows the workaround needed to stop tsserver from reading these parts of the filesystem.
Instead, module resolution should not look for node_modules directories outside project roots -- at least as specified in updateOpen messages, but I think there are other ways too.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing module resolution from updateOpen messages and the tsserver workaround described in the issue. Determine how project roots bound the search, then verify that resolution no longer reads node_modules outside those roots and add coverage for the affected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100