I am using Q in a project, and I am using bower to manage my JS dependencies. I am including Q 2.0.0 with bower in bower.json
"dependencies" : {
"q": "~2.0.0"
}
In my index.html, I include Q with a script tag
<script src="bower_components/q/q.js"></script>
When I load the page, I see in the console:
Uncaught ReferenceError: require is not defined q.js:43
Line 43 of q.js:
require("collections/shim");
What am I missing here? Should I be using Browserify or require.js to get this to work? I expected the library to be accessible by simply using a tag.
Bower is not very smart about selecting versions. As it happens, there is a 2.0 release train that is not compatible with Bower at all. You will want to install q#1.0.1 specifically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With