XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.2k stars 511 forks source link

ripple-0.16.8.js error: fails due to the ripple-lib missing arguments in... #702

Closed jnr101 closed 6 years ago

jnr101 commented 8 years ago

Hello,

When building the ripple-0.16.8.js following the guidelines from https://ripple.com/build/rippleapi-beginners-guide/#build-instructions an error occurs when using the ripple-0.16.8.js.

it fails due to the ripple-lib missing arguments in the function(modules, exports) on line 5500 where: module.exports = _;

Can you check please?

Thanks Jn_r

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/31803136-ripple-0-16-8-js-error-fails-due-to-the-ripple-lib-missing-arguments-in?utm_campaign=plugin&utm_content=tracker%2F323756&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F323756&utm_medium=issues&utm_source=github).
whotooktwarden commented 8 years ago

I can confirm this issue.

https://xagate.com/rippleapi/get_wallet.html uses 0.16.5.js meanwhile I have copied the file to https://xagate.com/rippleapi/testbug.html modifying the source to 0.16.8.js which breaks the functionality. The latter produces the following errors:

ripple-0.16.8.js:5500 Uncaught ReferenceError: _ is not defined and undefined

testbug.html:7 Uncaught TypeError: Cannot read property 'RippleAPI' of undefined

clark800 commented 8 years ago

@darkdarkdragon made lodash a separate dependency, try including lodash 3.1 separately

intelliot commented 6 years ago

@jnr101 This shouldn't be a problem in the current version of ripple-lib. Please let us know if you find otherwise. Thanks!

jnr101 commented 6 years ago

@intelliot I tested it and it worked. Thanks! Maybe you could update the 'master' to latest version? Following instructions from https://ripple.com/build/rippleapi-beginners-guide/#build-instructions I ended up with version 0.17.6 and had to do a "git checkout develop" to get version 0.17.7

intelliot commented 6 years ago

@jnr101 Good catch. I've updated master to 0.17.7. I also took a closer look at this issue. I think the problem was that lodash needs to be included on your page, e.g.

  <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.js"></script>

It works now because our example code now includes this script tag.

By the way, we plan to release 0.17.8 shortly, which works around a bug that can cause Safari 10.1 to freeze. I recommend upgrading when it's available next week :)

jnr101 commented 6 years ago

@intelliot you are correct, that line needs to be included. Good to see development of ripple-lib is pickup up again! (must say I have never had serious complaints about its functionality, it works for me like a charm)