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

property.name.kind access when property.name is undefined #93

Closed
clausreinke opened this issue Dec 17, 2019 · 2 comments
Closed

property.name.kind access when property.name is undefined #93

clausreinke opened this issue Dec 17, 2019 · 2 comments

Comments

@clausreinke
Copy link

clausreinke commented Dec 17, 2019

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 2.0.1
  • Rollup Version: 1.27.13
  • Operating System (or Browser): windows 10
  • Node Version: v8.16.2

How Do We Reproduce?

rollup-typescript-problem.zip

  1. unpack rollup-typescript-problem.zip
  2. npm i
  3. .\node_modules\.bin\rollup --config

Expected Behavior

compile without errors

Actual Behavior

>.\node_modules\.bin\rollup --config

index.ts → ....
[!] (plugin typescript) TypeError: Cannot read property 'kind' of undefined
index.ts
TypeError: Cannot read property 'kind' of undefined
    at visitObjectLiteralExpression (C:\test\node_modules\typescript\lib\typescript.js:80338:35)
    at visitJavaScript (C:\test\node_modules\typescript\lib\typescript.js:78758:28)
    at visitor (C:\test\node_modules\typescript\lib\typescript.js:78701:24)
    at Object.visitNode (C:\test\node_modules\typescript\lib\typescript.js:70936:23)
    at flattenBindingOrAssignmentElement (C:\test\node_modules\typescript\lib\typescript.js:73016:34)
    at flattenObjectBindingOrAssignmentPattern (C:\test\node_modules\typescript\lib\typescript.js:73078:21)
    at flattenBindingOrAssignmentElement (C:\test\node_modules\typescript\lib\typescript.js:73028:13)
    at Object.flattenDestructuringBinding (C:\test\node_modules\typescript\lib\typescript.js:72962:9)
    at visitVariableDeclaration (C:\test\node_modules\typescript\lib\typescript.js:80117:30)
    at Object.flatMap (C:\test\node_modules\typescript\lib\typescript.js:607:25)

Comment

If this isn't a bug in using typescript, it might be a bug in typescript itself, but I've only encountered it while using this rollup plugin. Please feel free to pass the buck to the TS team if
appropriate;-)

workaround/possible fix: in typescript.js, line 80338, protect property.name.kind by checking for property.name first.

@shellscape
Copy link
Collaborator

@clausreinke after running your repro it looks to me like the problem exists with typescript. I'm not a TS expert so I can't provide guidance there, but the stack trace is solely within the typescript module itself.

@shellscape
Copy link
Collaborator

Closing citing previous reply. Please let us know if you find different.

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

No branches or pull requests

2 participants