Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Cann't import the @ledgerhq/hw-transport-node-hid #266

Closed
zhangchiqing opened this issue Jan 8, 2019 · 2 comments
Closed

Cann't import the @ledgerhq/hw-transport-node-hid #266

zhangchiqing opened this issue Jan 8, 2019 · 2 comments

Comments

@zhangchiqing
Copy link

I'm trying to connect ledger in node:

yarn add @ledgerhq/hw-transport-node-hid

But the following code would throw:

var TransportNodeHid = require("@ledgerhq/hw-transport-node-hid");

Error logs:

/Users/leo/git/ledger/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js:355
      var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(path) {
                                                 ^

ReferenceError: regeneratorRuntime is not defined
    at /Users/leo/git/ledger/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js:355:50
    at /Users/leo/git/ledger/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js:394:6
    at Object.<anonymous> (/Users/leo/git/ledger/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js:398:2)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)

Node Version: v10.14.2
@ledgerhq/hw-transport-node-hid version: 4.33.3

Did I miss anything?

@gre
Copy link
Contributor

gre commented Jan 9, 2019

the current limitation is you need to depend on babel-polyfill and do import "babel-polyfill" OR require("babel-polyfill") at the beginning of your JS entry point.

e.g.

import "babel-polyfill";

@zhangchiqing
Copy link
Author

It works. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants