Skip to content
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

Fix incorrect use of "path" instead of "resolvedPath" when watching file's package json locations #57931

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

sheetalkamat
Copy link
Member

Fixes issue found at #57757

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Mar 25, 2024
Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! So let me see if I understand this correctly. In the failing test case, a referenced project’s output declaration file gets renamed due to a tsconfig edit, while the input source file keeps the same name. The source file’s path was the path to the input file and did not change during this edit, but its resolvedPath was the path to the declaration file and did change. So when the test was failing, existing had a length of 5, containing all the package.json locations looked up for the old declaration file name. After your change, existing is emptyArray, causing all the watched locations for the new declaration file name to be updated or created.

@jakebailey
Copy link
Member

Seems correct to me; the string is just a map key so its value doesn't seem to matter for other resolution stuff (which seems good).

@sheetalkamat
Copy link
Member Author

@andrewbranch exactly what you said.. we were incorrectly using "index.ts" as the location and thats not where the lookups happen so we were incorrectly deciding its just update with last element instead of new locations to watch.

@sheetalkamat sheetalkamat merged commit ac962ea into main Mar 25, 2024
25 checks passed
@sheetalkamat sheetalkamat deleted the affectLocations branch March 25, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants