Skip to content

Added affectsSourceFile to importHelpers and jsxImportSource - #59195

Merged
Armando Aguirre (armanio123) merged 5 commits into
microsoft:mainfrom
armanio123:AddMissingAffectSourceFile
Jul 10, 2024
Merged

Added affectsSourceFile to importHelpers and jsxImportSource#59195
Armando Aguirre (armanio123) merged 5 commits into
microsoft:mainfrom
armanio123:AddMissingAffectSourceFile

Conversation

@armanio123

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

Daniel Rosenwasser (DanielRosenwasser) commented Jul 9, 2024

Copy link
Copy Markdown
Member

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

@andrewbranch

Copy link
Copy Markdown
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
Copy Markdown
Member

Is this due to #58654? Does the change need to be cherry-picked to release-5.5? (CC Gabriela Araujo Britto (@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
Copy Markdown
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).

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

TypeScript Bot (@typescript-bot) cherry-pick to release-5.5

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 10, 2024

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
cherry-pick to release-5.5✅ Started✅ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey, Andrew Branch (@andrewbranch)! I've created #59231 for you.

@armanio123
Armando Aguirre (armanio123) merged commit 972e9a7 into microsoft:mainJul 10, 2024
Daniel Rosenwasser (DanielRosenwasser) pushed a commit that referenced this pull request Jul 16, 2024
…e-5.5 (#59231)
Co-authored-by: Armando Aguirre <armando.aguirre@microsoft.com>
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

8 participants

@armanio123@DanielRosenwasser@andrewbranch@gabritto@typescript-bot@sheetalkamat@sandersn@jakebailey