I am trying to create a custom USB service using node-usb that fires an event whenever a device connects. The service works fine when I create a function to get a list of connected devices, but I get an error when I try to listen to node-usb’s attach event.
ERROR TypeError: Cannot read property 'apply' of undefined at [...]/node_modules/@theia/core/lib/common/event.js:176:33
It looks like my callback does not get passed correctly to the Event. Is my binding wrong? Any ideas?
Here is my code: https://pastebin.com/0xjJnfXD