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

Nightly error #10778

Closed
jods4 opened this issue Sep 8, 2016 · 5 comments · Fixed by #10798
Closed

Nightly error #10778

jods4 opened this issue Sep 8, 2016 · 5 comments · Fixed by #10798
Assignees
Labels
Bug A bug in TypeScript Domain: Transforms Relates to the public transform API Fixed A PR has been merged for this issue

Comments

@jods4
Copy link

jods4 commented Sep 8, 2016

After @mhegazy's comment I wanted to give the new codegen a try and downloaded 2.1.0-dev.20160907 (I am currently using Babel js).

The result on my codebase is a compiler crash:

TypeError: Cannot read property 'text' of undefined
    at addExportMemberAssignmentsForBindingName (D:\****\node_modules\typescript\lib\typescript.js:45135:95)
    at addExportMemberAssignmentsForBindingName (D:\****\node_modules\typescript\lib\typescript.js:45131:21)
    at visitVariableStatement (D:\****\node_modules\typescript\lib\typescript.js:45119:17)
    at visitor (D:\****\node_modules\typescript\lib\typescript.js:44882:28)
    at Object.visitNodes (D:\****\node_modules\typescript\lib\typescript.js:40012:48)
    at transformAsynchronousModuleBody (D:\****\node_modules\typescript\lib\typescript.js:44836:40)
    at transformAsynchronousModule (D:\****\node_modules\typescript\lib\typescript.js:44822:41)
    at transformAMDModule (D:\****\node_modules\typescript\lib\typescript.js:44757:20)
    at transformSourceFile (D:\****\node_modules\typescript\lib\typescript.js:44719:31)
    at D:\****\node_modules\typescript\lib\typescript.js:51196:89

I am sorry but I can't put up a repro our codebase is large and confidential :(

@mhegazy mhegazy added the Bug A bug in TypeScript label Sep 8, 2016
@mhegazy mhegazy added this to the TypeScript 2.1 milestone Sep 8, 2016
@mhegazy mhegazy added the Domain: Transforms Relates to the public transform API label Sep 8, 2016
@rbuckton
Copy link
Member

rbuckton commented Sep 8, 2016

I found a simple repro. This issue occurs when you have a top level variable declaration with an array binding pattern that has a missing element and also have export specifiers in the same file:

const [a, , b] = [1, 2, 3];
export { a, b };

We parse the missing element as an OmittedExpression but incorrectly cast it to a BindingElement which always expects to have a valid name property.

I have a fix I will be pushing up shortly, and should be available in the next nightly build.

@jods4
Copy link
Author

jods4 commented Sep 8, 2016

@rbuckton We definitely have this pattern somehwere in our code. I know because it was introduced very recently, like during the past week ;) So I guess that's it!

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Sep 9, 2016
@DanielRosenwasser
Copy link
Member

@rbuckton sent out a fix. Keep an eye out for the next nightly (~2-3 hours).

@jods4
Copy link
Author

jods4 commented Sep 9, 2016

@rbuckton @DanielRosenwasser Will test again with our codebase on Monday.

@jods4
Copy link
Author

jods4 commented Sep 12, 2016

Tested today with dev.20160912, the compiler crash is gone. Thanks.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Transforms Relates to the public transform API Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants