Reputation: 6349
I am having a problem with using jQuery in my Meteor app. It is undefined.
When I look inside .meteor/versions
, I can clearly see:
[email protected]_2
But when I type $
or jQuery
in my Chrome console, I get undefined
. Also, I cannot use external packages that use any jQuery; I get undefined is not a function
exception.
Manually adding jQuery package by meteor add jquery
did not solve the issue.
Any idea why this happens?
Upvotes: 0
Views: 1856
Reputation: 2386
jQuery is inside the meteor core and defined as a dependency inside meteor-platform. So I never declare it as a a dependency. Meteor relies heavily on it, so it's unlikely to ever be removed. Unlike underscore, which they stated they will remove in a future release. Meteor always aliases $
. So that should work. It can't be an issue with that specific version. I'm running the same without any issues. Here are some things you could try to debug:
Packages get loaded before your code, so that can't be the problem.
Upvotes: 2