danger / danger/peril

Error in babel when using "let"

Open
#201 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
460
Forks
55
PR merge metrics
No merged PRs in 30d

Description

We are getting an error with our pr danger file after we added in one new line.
```
let labels = let labels = danger.github.issue.labels.map(l => l.name);
```

But if I use "var" everything works fine

This is the error that occurs when using "let"

```
/app/danger-0.ffgmk6xn2dt.js: Cannot read property 'bindings' of null
TypeError: /app/danger-0.ffgmk6xn2dt.js: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/app/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:960:13)
at BlockScoping.updateScopeInfo (/app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (/app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (/app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
at newFn (/app/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:234:21)
at NodePath._call (/app/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:67:18)
at NodePath.call (/app/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:42:17)
at NodePath.visit (/app/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:98:12)
at TraversalContext.visitQueue (/app/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:136:16)
at TraversalContext.visitSingle (/app/node_modules/babel-core/node_modules/babel-traverse/lib/context.js:96:19)
```
I found a reference the exact error and backtrace here, which seems to imply a mismatch of babel core versions and plugins versions.

Reference: https://github.com/babel/babel/issues/6186

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.