'Nano Ledger S in Angular

Today I ran into a problem while trying to connect my NANO Ledger S to my angular app.

I've tried installing this package yet it does not seem to work due to the package throwing some errors.

Module '"events"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

This can be fixed by putting changing the EventEmmiter import to

import {EventEmitter} from "events";

Now at least the app compiles, but when I to access the Devices over the TransportWebUSB class a "ERROR Error: Uncaught (in promise): ReferenceError: Buffer is not defined ReferenceError: Buffer is not defined" error is thrown in the console.

I've tried different stuff like following this tutorial and adding

new webpack.ProvidePlugin({
  Buffer: ['buffer', 'Buffer'],
})

this custom Plugin (idk, thats what the internet told be).

I have tried everything I so StackOverflow is my last resort. Thanks for the answers!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source