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?
I could take a look if you could set up a public repo I can clone and build. It is hard to figure out what is causing the TypeError: Cannot read property 'apply' of undefined error from the pastebin snippet.