Closed LauraWebdev closed 3 months ago
The line it is failing on looks to be export class WebHIDDevice extends EventEmitter implements CoreHIDDevice {
which makes some sense from the error message. The class being extended is imported with import { EventEmitter } from 'events'
, so it sounds like vite
is not polyfilling the events
nodejs api sufficiently, causing our import to fail.
I have no experience with vite
, so hopefully this is something you can figure out, but the webhid demo shows it is possible to make it work with webpack. I will accept a pr to change where the EventEmitter
class is imported from (I am a little surprised that I didn't make this be using https://www.npmjs.com/package/eventemitter3 already)
This sounds like a misconfiguration, and not something that needs a change to be made here
Hey there, I've setup the webhid-demo with all dependencies and was able to confirm it worked properly with my setup. Now I want to create a minimal test project to play around with the tools myself.
I've created a Vite-Vue3 project with nothing but a button for selecting the device, importing any of the @elgato-stream-deck/webhid packages fail with the same error, no matter whether I'm using JS or TS.
Here is my App.vue for testing purposes:
Even with this file, I am receiving the same error: