stripe-archive/shop

Uncaught ReferenceError: _ is not defined

bondarewicz opened this issue · 2 comments

After changing cloud/views/index.ejs file to use non minified shop.js

<script src="/assets/js/shop.min.js?1377809478"></script>
to 
<script src="/assets/js/shop.js"></script>

Getting Uncaught ReferenceError on below line

var itemTemplate = _.template($('#item-template').html());

in here

shop.min.js is not the minified version of shop.js, but a compilation of a set of files that includes shop.js -- have a look at the definition here: https://github.com/stripe/shop/blob/master/Gruntfile.js#L13

If you only include shop.js, the other files won't be included. You either have to recompile shop.min.js using Grunt, or include all the other files mentioned in the Gruntfile in addition to shop.js.

@jonasschneider 👍 thanks very helpful, closing