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

Added affectsSourceFile to importHelpers and jsxImportSource #59195

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

armanio123
Copy link
Member

Fixes #59168 (comment)

The issue happens in a project containing nested projects. One of them defines "importHelpers": true, while the root config doesn't.

In this scenario, depending on the order the files are opened an incorrect checker is used causing to hit the assert: Debug Failure. False expression: Expected sourceFile.imports[0] to be the synthesized tslib import.

Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

This is good but test case would be better

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jul 9, 2024

Is this due to #58654? Does the change need to be cherry-picked to release-5.5? (CC @gabritto)

@andrewbranch
Copy link
Member

The inconsistency was always there, but the debug assert is new in #58451, so yes, a cherry-pick would be good

@gabritto
Copy link
Member

gabritto commented Jul 9, 2024

Is this due to #58654? Does the change need to be cherry-picked to release-5.5? (CC @gabritto)

Adding to what Andrew said, #58654 makes us call the function with the failed assertion for potentially every file in a project instead of once per checker.

@andrewbranch
Copy link
Member

Also FWIW, the reason we're not seeing user reports about this is you need a project references scenario where two projects contain the same source file and differ in compiler options only in importHelpers, and it's dependent on project creation order (the one without importHelpers has to create the shared source file).

@jakebailey jakebailey closed this Jul 10, 2024
@jakebailey jakebailey reopened this Jul 10, 2024
Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

Pls fix formatting

@andrewbranch
Copy link
Member

@typescript-bot cherry-pick to release-5.5

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jul 10, 2024

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
cherry-pick to release-5.5 ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

Hey, @andrewbranch! I've created #59231 for you.

@armanio123 armanio123 merged commit 972e9a7 into microsoft:main Jul 10, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[ServerErrors][TypeScript] 5.6.0-dev.20240707 vs 5.5.3
7 participants