particle-iot / particle-usb

A library for accessing Particle USB devices
Apache License 2.0
5 stars 1 forks source link

bug/sc-111009/webusberror-in-control-transfer-failed #71

Closed busticated closed 2 years ago

busticated commented 2 years ago

Description

The upgrade to Webpack v5 broke usage of Node.js built-ins as those are no longer automatically polyfilled (docs). This PR adds in the required dependency and configuration settings required to make Buffer usable in the browser context again.

How to Test

  1. Pull down this branch:
    • git pull && git checkout bug/sc-111009/webusberror-in-control-transfer-failed
  2. Ensure you are running under the required Node.js version:
    • nvm use (or equivalent - e.g. fnm use)
  3. Reinstall dependencies:
    • npm run reinstall
  4. Run tests:
    • npm run test:ci
  5. Manually run the "Enters listening mode" e2e test (instructions)

Outcome

All CI tests should pass, package-lock.json file should not show changes after reinstalling, "Enters listening mode" e2e test should pass when run manually.

Related / Discussions

https://app.shortcut.com/particle/story/111009 https://github.com/particle-iot/particle-usb/pull/66