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

regeneratorRuntime not defined error in new xrp app #258

Closed
Marxpark opened this issue Dec 12, 2018 · 9 comments
Closed

regeneratorRuntime not defined error in new xrp app #258

Marxpark opened this issue Dec 12, 2018 · 9 comments

Comments

@Marxpark
Copy link

New xrp app doesn't work (at least for me). Constantly throws error regeneration runtime is not defined:

./node_modules/@ledgerhq/hw-app-xrp/lib/Xrp.js:53
      var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(path, display, chainCode, ed25519) {
                                                 ^

ReferenceError: regeneratorRuntime is not defined
    at ./node_modules/@ledgerhq/hw-app-xrp/lib/Xrp.js:53:50
    at ./node_modules/@ledgerhq/hw-app-xrp/lib/Xrp.js:106:6
    at Object.<anonymous> (./node_modules/@ledgerhq/hw-app-xrp/lib/Xrp.js:290: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:20:18)

if i add const regeneratorRuntime = require("regenerator-runtime"); in the lib/xrp.js, it starts working normally.

@Marxpark
Copy link
Author

Same issue happening on transport hid
js/node_modules/@ledgerhq/hw-transport-node-hid/lib/TransportNodeHid.js:354
var _ref = _asyncToGenerator( /#PURE/regeneratorRuntime.mark(function _callee(path) {

@meriadec
Copy link
Member

looks like you need to add babel-polyfill

@Marxpark
Copy link
Author

Yeah, google said that in a couple of posts, but its not the appropriate solution. If it's a known requirement, it should be in the dependancies? And in a way, it is, because if i add the require statement, then everything works fine. The last version of the app (4.25) works perfectly fine out of the box, not having to install any of babel deps.
And even when i installed babel polyfill, it still didnt work for me...

@meriadec
Copy link
Member

it originated here #228
I agree, it's a pain to have this particularity. Should be temporary until moving to babel@7

@Marxpark
Copy link
Author

Googled the s*** out of the error, didnt find that thread. Thanks!

@Moejoe90
Copy link

I think this problem should be still open as moving to babel@7 didn't solve it

@MicahZoltu
Copy link
Contributor

I am getting this with latest release 0.48.0 in a very simple project (almost no other dependencies besides ledgerhq stuff).

@MicahZoltu
Copy link
Contributor

The recommended solution of import "babel-polyfill" doesn't work, just results in Cannot find module 'babel-polyfill'.

@meriadec
Copy link
Member

npm i babel-polyfill

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

4 participants