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.
Ensure you are running under the required Node.js version:
nvm use (or equivalent - e.g. fnm use)
Reinstall dependencies:
npm run reinstall
Run tests:
npm run test:ci
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.
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 makeBuffer
usable in the browser context again.How to Test
git pull && git checkout bug/sc-111009/webusberror-in-control-transfer-failed
nvm use
(or equivalent - e.g.fnm use
)npm run reinstall
npm run test:ci
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