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 getReflectionsFromSymbolId from returning undefined elements #2511

Closed

Conversation

nbilyk
Copy link

@nbilyk nbilyk commented Feb 29, 2024

Returning [undefined] causes downstream TypeErrors.

Example:

TypeError: Cannot read properties of undefined (reading 'kindOf')
    at ./node_modules/typedoc/dist/lib/models/types.js:688:25
    at Array.find (<anonymous>)
    at get reflection [as reflection]

Returning [undefined] causes downstream TypeErrors.

Example:
```
TypeError: Cannot read properties of undefined (reading 'kindOf')
    at ./node_modules/typedoc/dist/lib/models/types.js:688:25
    at Array.find (<anonymous>)
    at get reflection [as reflection]
```
@nbilyk nbilyk force-pushed the fix-get-reflections-from-symbol branch from 9ff23fd to 2ea0eaf Compare February 29, 2024 03:41
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 29, 2024

These assertions are in place because it shouldn't be possible for ids in symbolToReflectionIdMap to be invalid. If they are, that's a bug elsewhere. This hides the problem, but it's still broken.

@nbilyk
Copy link
Author

nbilyk commented Mar 1, 2024

Gerrit, I thought that might be the case, although this commit does avoid what I was hitting.

I unfortunately don't have an isolated test case to provide, it happens when a library re-exports modules from another library that has type declarations.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 2, 2024

Could you point me to it anyways? I might have enough time this weekend to dive into it

@nbilyk
Copy link
Author

nbilyk commented Apr 1, 2024

Closing, I updated to 25.12 and no longer have this issue. Thanks whomever fixed this for me :)

@nbilyk nbilyk closed this Apr 1, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Apr 1, 2024

Strange... nothing that I can remember should have changed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants