Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix crash when trying to import a non-exported type#36619

Merged
andrewbranch merged 2 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
andrewbranch:bug/36592andrewbranch/TypeScript:bug/36592Copy head branch name to clipboard
Feb 5, 2020
Merged

Fix crash when trying to import a non-exported type#36619
andrewbranch merged 2 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
andrewbranch:bug/36592andrewbranch/TypeScript:bug/36592Copy head branch name to clipboard

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

Fixes #36592
Fixes #36614

Comment thread src/compiler/checker.ts Outdated

addRelatedInfo(diagnostic,
createDiagnosticForNode(localSymbol.valueDeclaration, Diagnostics._0_is_declared_here, declarationName)
createDiagnosticForNode(localSymbol.valueDeclaration ?? localSymbol.declarations[0], Diagnostics._0_is_declared_here, declarationName)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There could be more than one declaration, but exporting any of them will fix the error, so 🤷‍♂

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.

You could also report an error on all of them which might feel cleaner and work well too.

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.

I'd probably just avoid the ...map and use forEach but whatever you'd prefer.

@DanielRosenwasser DanielRosenwasser left a comment

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.

Consider adding related info on each declaration instead, but looks good.

@andrewbranch

Copy link
Copy Markdown
Member Author

👍 updated

@andrewbranch

Copy link
Copy Markdown
Member Author

@typescript-bot cherry-pick this to release-3.8

@DanielRosenwasser

Copy link
Copy Markdown
Member

I've heard the bot is having trouble because of octokit.

@DanielRosenwasser

Copy link
Copy Markdown
Member

This should probably go in the RC since 2 people just reported errors on it in the VS Code codebase.

@andrewbranch andrewbranch merged commit 2047118 into microsoft:master Feb 5, 2020
@andrewbranch andrewbranch deleted the bug/36592 branch February 5, 2020 16:28
andrewbranch added a commit to andrewbranch/TypeScript that referenced this pull request Feb 5, 2020
* Fix crash when trying to import a non-exported type

* Add related info on each declaration
andrewbranch added a commit that referenced this pull request Feb 5, 2020
* Fix crash when trying to import a non-exported type

* Add related info on each declaration
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Cannot read property 'kind' of undefined in vscode build Crash: Cannot read property 'kind' of undefined

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.