dorukeker / gyronorm.js

JavaScript project for accessing and normalizing the accelerometer and gyroscope data on mobile devices
MIT License
641 stars 65 forks source link

Uncaught TypeError: Cannot set property 'GyroNorm' of undefined #33

Closed uMaxmaxmaximus closed 7 years ago

uMaxmaxmaximus commented 7 years ago

webpack, strict mode; in strict mode this in functions is undefined! you use (function(root){ code })(this) is not correct! you not correct detect root object!

need:

var root = Function("return this")();

Function constructor stopping "strict mode" scope, and this link to global object.

image

GabrielGil commented 7 years ago

hi! Glad to find out more people are using Gyronorm with webpack. I have changed the exporting on febcc79d39abf1468a6feefb19b4b03ffde59732, this has been released on 2.0.6, but @dorukeker didn't build it on the complete version.

This is why I believe this does not apply to the latest version.

Please, let me know if I can be of any help. :)

dorukeker commented 7 years ago

Hi @GabrielGil I now see your PR was not included to the release. I remade the release. It should be solved now.

Can you have a look and let me know if all works fine?

Cheers, Doruk

GabrielGil commented 7 years ago

Yes, it is perfect now. I had actually mentioned in my pr (https://github.com/dorukeker/gyronorm.js/pull/30#issuecomment-275853161) that just needed the build and version number updates.

Thank you one more time @dorukeker