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

Browser-Build Reference Error in Javascript #733

Closed pftq closed 6 years ago

pftq commented 8 years ago

I used the directions here to build a browser-compatible JS file: https://ripple.com/build/rippleapi-beginners-guide/#build-instructions

But when I run the example HTML, I get the following error in Chrome: ripple-0.17.1.js:8284 Uncaught ReferenceError: _ is not defined

That line in the js file is: module.exports = _;

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37638144-browser-build-reference-error-in-javascript?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).
sharafian commented 8 years ago

The browser version of ripple-lib expects you to include lodash in your webpage. Try adding

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.js"></script>
pftq commented 8 years ago

Thanks, this was not clear to me from the project or developer guide.

intelliot commented 6 years ago

The example code has been updated to include lodash. Closing.