Closed nisargjhaveri closed 1 year ago
Also, calling getDevices
just before transferIn
call makes the transferIn
call fail with the below error.
./node_modules/usb/dist/webusb/webusb-device.js:431
throw new Error("transferIn error: " + error_7);
^
Error: transferIn error: TypeError: Cannot read properties of undefined (reading 'transfer')
at WebUSBDevice.<anonymous> (./node_modules/usb/dist/webusb/webusb-device.js:431:31)
at step (./node_modules/usb/dist/webusb/webusb-device.js:33:23)
at Object.next (./node_modules/usb/dist/webusb/webusb-device.js:14:53)
at ./node_modules/usb/dist/webusb/webusb-device.js:8:71
at new Promise (<anonymous>)
at __awaiter (./node_modules/usb/dist/webusb/webusb-device.js:4:12)
at WebUSBDevice.transferIn (./node_modules/usb/dist/webusb/webusb-device.js:404:16)
at ./dist/client/trial.js:68:12
at Generator.next (<anonymous>)
at fulfilled (./dist/client/trial.js:5:58)
Looks like this is likely because of the fact that getDevices
call creates new instances of the device and does not return the same instance when called again. Created PR #567 to address this.
This should not be fixed in master since #567 was merged.
@thegecko, Curious: What is the release cycle we're following? When should I expect a version that includes the fix for this?
It's building now
That's quick! Thanks a lot! :)
Bug Description:
getDevices
call using the WebUsb interface does not include a device which was earlier available and has an active transferIn request.Steps to Reproduce:
getDevices
.getDevices
again.getDevices
does not include the device.Here is a snippet I was able to reproduce this with.
Output:
Additional Information
node -v
orelectron -v
): node v16.16.0npm ls usb
): usb@2.6.0