Undefined enum
blmarket opened this issue · comments
nuimojs/src/device.js:180
case (Nuimo.Direction.LEFT):
^
TypeError: Cannot read property 'LEFT' of undefined
you should export Direction at nuimo.js
Hi, which version of Node are you using? The export of nuimo.js
is the Nuimo class, for which there is a static getter for the Direction enum. I'm not able to reproduce this.
Reproduction step is not clear enough, sorry about that. it was
- run examples/interaction.js
- swipe nuimo to left
- bang!
Last test was on node version v6.3.0
.
$ node -v
v6.3.0
My analysis is here.
As nuimo.js
and device.js
are in circular dependency, so Nuimo.Direction
is undefined when device.js
is trying to import it. you better remove those circular dependencies.
Created PR #4 to fix, PTAL
Thank you, tested and works! Merged.
😀 eager waiting next release!