I’m using Bootstrap 3 which I imported through the twbs:bootstrap package. It’s a simple program that is just displaying a countdown timer on the webpage (for the launch of my app).
However, I get the following error messages preventing me from starting Meteor:
Error: Bootstrap's JavaScript requires jQuery
at bootstrap/js/bootstrap.js:8:9
at /Users/andreaswest/Documents/workspace/landing/.meteor/local/build/programs/server/app/bootstrap/js/bootstrap.js:2067:4
at /Users/andreaswest/Documents/workspace/landing/.meteor/local/build/programs/server/boot.js:242:10
at Array.forEach (native)
at Function._.each._.forEach (/Users/andreaswest/.meteor/packages/meteor-tool/.1.1.10.13pfp1d++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /Users/andreaswest/Documents/workspace/landing/.meteor/local/build/programs/server/boot.js:137:5
jquery is already in the list of loaded packages with version 1.2
My packages:
meteor-base # Packages every Meteor app needs to have
mobile-experience # Packages for a great mobile UX
mongo # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
session # Client-side reactive dictionary for your app
jquery # Helpful client-side library
tracker # Meteor’s client-side reactive programming library
standard-minifiers # JS/CSS minifiers run for production mode
es5-shim # ECMAScript 5 compatibility for older browsers.
ecmascript # Enable ECMAScript2015+ syntax in app code
Since you’ve already added the bootstrap package, you don’t need to include it anywhere else (or refer to it in your index.html). Meteor will take care of this for you. So to get this working:
Add the jquery package back in: meteor add jquery
Remove bootstrap everywhere you have it (all locations - so completely remove the bootstrap directory in your project root, remove it from the js directory in your project root, and remove it from your client/lib directory).
Remove jquery everywhere you have it (all locations - so remove it from your client/lib directory and your js directory).
Remove the references to Bootstrap and jQuery in your index.html - so completely remove:
<script type=“text/javascript” src=“client/lib/a_jquery-1.11.1.min.js”></script>
<script type=“text/javascript” src=“client/lib/bootstrap.min.js”></script>
You should also re-read the Structuring your application section of the Meteor docs, paying close attention to what happens to files in directories outside of Meteor’s special directories (which was a large part of the problem in your case since Meteor was attempting to load your Bootstrap JS files on both the client and server).
ReferenceError: require is not defined
at bootstrap/js/npm.js:2:1
at /Users/andreaswest/Documents/workspace/landing/.meteor/local/build/programs/server/app/bootstrap/js/npm.js:24:4
at /Users/andreaswest/Documents/workspace/landing/.meteor/local/build/programs/server/boot.js:242:10
Will try and see what happens if I delete more files, starting with npm.js
So the problem is Bootstrap installing it’s code in all those locations that Meteor is anal about it? That’s exactly why I was having a discussion on FB yesterday about why it’s so difficult for other UI’s like eg Polymer to work together with Meteor.
Guess it all has to do with who’s the prophet and who’s the mountain