-
Notifications
You must be signed in to change notification settings - Fork 377
regeneratorRuntime is not defined #332
Comments
I suspect this is due to https://github.com/LedgerHQ/ledgerjs/blob/master/.babelrc#L10 , we'll need to assess in our side why we needed that in the past and if we can drop it. The only problem we have on our side is that our Ledger Live Desktop build still uses an old version of babel so it might become important we migrate on our side to more recent versions. |
WorkaroundIf you are using firmware 1.5.5 or above with latest ledger apps, you can use this; import LedgerProvider from '@liquality/ledger-provider'
// or const LedgerProvider = require('@liquality/ledger-provider')
const LedgerTransport = LedgerProvider.getTransport({ config: useWebBle? }) and then use
Example: https://cross-chain-playground.hv.pizza/ Cheers. |
we definitely want to ship an es5 CJS module as well as an es module here so that bundlers can pull the one the understand. projects should also be in charge of making sure that all of the features that this module expects are available (either natively or polyfilled) without the apparent dependency on regenerator-runtime |
Great!, same issue here, any news regarding this ? nd no, I do not want to use the latest firmwar version that critically limit the memory on the device ... |
Can confirm I have the same issue with both EDIT: Temporarily solved by importing |
As a temporary solution for E.g. import "regenerator-runtime"; // required by @ledgerhq/hw-transport-node-hid
// ...
import Transport from "@ledgerhq/hw-transport";
import TransportNodeHid from "@ledgerhq/hw-transport-node-hid"; |
@webmaster128 Thank you, nice work-around, can't wait for #241 getting a rebase and merge. |
Any status update on this? |
yes we are migrating all our projects and once everything is stable and working we should be able to merge #428 that no longer have this issue's problem |
This is fixed by v5.0.0 |
main.js
Running this program results in
regeneratorRuntime is not defined
.#266 says I need to do
require('babel-polyfill')
, but that just results inCannot find module 'babel-polyfill'
.Presumably I can install babel-polyfill as a dependency to resolve this, but now we are getting pretty deep into the weeds. This definitely feels like a bug in the hw-transport-node-hid module. Why do I need a babel polyfill to call a js library with a modern version of node (v10.15.0)? If this is a hard dependency, why do I need to depend on it rather than getting it transitively? Why are packages being published that depend on transpilers? Transpiling should be done before the package is uploaded to NPM.
Most importantly, why are all of the GitHub issues where people have brought this up closed? This issue certainly isn't fixed, and it certainly isn't proper behavior of a library.
The text was updated successfully, but these errors were encountered: