-
Notifications
You must be signed in to change notification settings - Fork 12.8k
TypeError: Cannot read property 'length' of undefined at Object.forEachChild #18301
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
Comments
Verified . The fix is simple, but why are we even touching JSDoc in |
@DanielRosenwasser we still parse it to get documentation, I believe |
Thanks for the quick response! Good to hear that it's an easy fix. Will this be fixed in 2.5.x as well? A few backend services at work cannot update their compiler yet, because they depend on an old version of protobufjs which triggers this bug. Low priority of course, but it would be nice not having this bit of friction in the mean time. |
@weswigham We do parse it but should only be binding it in .js files. |
This crashes in the parser, not the binder, for me, from #17352 onwards. #17352 is where I modified
|
forEachChild only visits JSDocTypeLiteral.jsDocPropertyTags, not JSDocTypeLiteral.jsDocTypeTag. Since one and only one should be defined, it should visit whichever one is defined. Alternatively, JSDocTypeLiterals should only be created for type definitions with jsdocPropertyTags. It would be nice to raise subsequent |
Fix is up at #18333. I implemented the second alternative. |
Should this issue have the "fixed" label? The other bugs closed in 2.5.3 all do. |
If this may be related angular/angular-cli#5053 (comment) |
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: 2.5.2 and 2.6.0-dev.20170906 (can reproduce on both versions)
Code
Expected behavior: Code compiles successfully.
Actual behavior:
Compiler crashes with the following error:
The text was updated successfully, but these errors were encountered: