After failing to use this library on my main project, I experimented with some sandbox projects to try and get to the root of the issue.
I was able to use this library with Vue 2.0 + Vue CLI (which uses Webpack), but when I tried to use it in a Vue 2.0 + Brunch project, I encountered the same errors I saw on my main project.
When executing this code
const transport = await TransportU2F.create();
const eth = new Eth(transport);
const { address } = await eth.getAddress("44'/60'/0'/0'/0");
the last line throws the following TypeError: ascii is not a function
I've experimented with other transports, which also failed. It's worth mentioning that in the case of @ledgerhq/hw-transport-node-hid, the error is TypeError: Buffer.alloc is not a function originating from the following code in hid-framing.js
After failing to use this library on my main project, I experimented with some sandbox projects to try and get to the root of the issue.
I was able to use this library with Vue 2.0 + Vue CLI (which uses Webpack), but when I tried to use it in a Vue 2.0 + Brunch project, I encountered the same errors I saw on my main project.
When executing this code
the last line throws the following
TypeError: ascii is not a function
which originates from here:
I've experimented with other transports, which also failed. It's worth mentioning that in the case of @ledgerhq/hw-transport-node-hid, the error is
TypeError: Buffer.alloc is not a function
originating from the following code inhid-framing.js
Unlike the U2F case, this error is thrown when the
node-hid
transport library is imported.Here is the minimum amount of code required to reproduce this issue.
app/main.js
app/App.vue
app/assets/index.html
package.json
brunch-config.js
Your insight would be greatly appreciated. Thank you.