Skip to content

Handle failure to properly resolve type reference directives#20374

Merged
uniqueiniquity merged 4 commits into
microsoft:masterfrom
uniqueiniquity:symlinkTypeReferenceDirective
Mar 29, 2018
Merged

Handle failure to properly resolve type reference directives#20374
uniqueiniquity merged 4 commits into
microsoft:masterfrom
uniqueiniquity:symlinkTypeReferenceDirective

Conversation

@uniqueiniquity
Copy link
Copy Markdown
Contributor

Adding small null check.

Customer reported an issue whereby file was undefined or null in a CI scenario but not in a local build.
The solution for the customer was to set preserveSymlinks: true, but this was not clear from the error message.
This change intends to make the error clearer. Suggestions regarding whether this is the proper way to report this error are welcome.

@uniqueiniquity uniqueiniquity requested a review from a user November 30, 2017 18:28
@uniqueiniquity
Copy link
Copy Markdown
Contributor Author

@Andy-MS as far as I can tell, realpath cannot return undefined. So what seems to be happening is that when the symlink is resolved, the file it points to is not present in Program.filesByName (forgive the abuse of notation here), and therefore host.getSourceFile returns undefined. I've changed the type here to reflect this possibility of returning undefined. What do you think is the best way to handle the scenario?

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Jan 8, 2018

@Andy-MS can you take a look. we have seen this happen in realworld case, i am not sure i understand the repro, but can you help @uniqueiniquity to get a repro crafted?

@uniqueiniquity
Copy link
Copy Markdown
Contributor Author

@Andy-MS Any updates? Last we spoke, you said you were going to look into this.

@uniqueiniquity uniqueiniquity force-pushed the symlinkTypeReferenceDirective branch from 92d4883 to 46fa477 Compare January 20, 2018 00:38
@uniqueiniquity
Copy link
Copy Markdown
Contributor Author

Rebased to pick up changes.

@uniqueiniquity
Copy link
Copy Markdown
Contributor Author

@Andy-MS is this what you thought made sense?

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Mar 29, 2018

@uniqueiniquity is this good to go?

@uniqueiniquity
Copy link
Copy Markdown
Contributor Author

@mhegazy Sorry for losing track of this. I'm re-running travis in case anything broke in the interim, but otherwise yes.

@uniqueiniquity uniqueiniquity merged commit d2d0f86 into microsoft:master Mar 29, 2018
@uniqueiniquity uniqueiniquity deleted the symlinkTypeReferenceDirective branch March 29, 2018 22:26
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to 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.

2 participants