bryan-bartow / homebridge-alarm.com

Alarm.com plugin for Homebridge
ISC License
43 stars 11 forks source link

Unexpected token ILLEGAL - ERROR LOADING PLUGIN homebridge-alarmdotcom #33

Closed amitgandhinz closed 7 years ago

amitgandhinz commented 7 years ago

My Alarm.com plugin seems to have started failing this weekend. Not sure if others experience the same.

ct 31 11:37:42 raspberrypi homebridge[8343]: [10/31/2016, 11:37:42 AM] ====================
Oct 31 11:37:42 raspberrypi homebridge[8343]: [10/31/2016, 11:37:42 AM] ERROR LOADING PLUGIN homebridge-alarmdotcom:
Oct 31 11:37:42 raspberrypi homebridge[8343]: [10/31/2016, 11:37:42 AM] SyntaxError: Unexpected token ILLEGAL
Oct 31 11:37:42 raspberrypi homebridge[8343]: at exports.runInThisContext (vm.js:53:16)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module._compile (module.js:413:25)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Object.Module._extensions..js (module.js:452:10)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module.load (module.js:355:32)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Function.Module._load (module.js:310:12)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module.require (module.js:365:17)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at require (module.js:384:17)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-alarmdotcom/node_modules/asn1/lib/ber/index.js:6:14)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module._compile (module.js:434:26)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Object.Module._extensions..js (module.js:452:10)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module.load (module.js:355:32)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Function.Module._load (module.js:310:12)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module.require (module.js:365:17)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at require (module.js:384:17)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-alarmdotcom/node_modules/asn1/lib/index.js:6:11)
Oct 31 11:37:42 raspberrypi homebridge[8343]: at Module._compile (module.js:434:26)
Oct 31 11:37:42 raspberrypi homebridge[8343]: [10/31/2016, 11:37:42 AM] ====================

It looks like when the plugin attempts to load, it fails, and then homebridge itself crashes since the plugin cannot be found/registerd due to the loading issue.

bryanbartow commented 7 years ago

I have not seen this, although I have not restarted homebridge in some number of weeks. I'll try when I get home and report back.

bryanbartow commented 7 years ago

@amitgandhinz I just stopped and restarted homebridge. Everything is running fine. However, I have not update homebridge in quite some time. Maybe there are issues in a recent release? I'll upgrade and see if it still works.

bryanbartow commented 7 years ago

@amitgandhinz I just installed the latest release of homebridge and everything works fine. I have to assume this is either a raspberrypi issue or due to one of your other plugins. Those are obviously just guesses, though.

amitgandhinz commented 7 years ago

ok weird. mine was working fine and randomly stopped working with this plugin. Im going to try some more things this weekend to see what could be causing it. It doesn't look like anything was updated specifically with this plug in, so maybe something else is causing this particular on to fail. I will let you know what i find.

Thanks for looking into it.

amitgandhinz commented 7 years ago

okay figured it out. the main homebridge package had upgraded and took on a dependency on the latest node version. After upgrading node and reinstalling (npm install -g homebridge) I was able to narrow down the issue with alarmdotcom using a corrupted asn library. So i uninstalled and reinstalled the homebridge-alarmdotcom package, and all issues appear to be now resolved.

Not sure how that asn package was corrupted. I suspect it was due to the change in node versions.

In Conclusion

  1. Upgrade node version to the latest (v7). I did it via n
  2. Uninstall, then Reinstall npm install -g homebridge
  3. Uninstall, then Reinstall npm install -g homebridge-alarmdotcom
bryanbartow commented 7 years ago

@amitgandhinz Cool. Glad it's working again.