jQuery: $ name not found


#1

I’m using meteor 1.3.3.1 in my application. As jquery packge is pre-available when i’m trying to use symbol $ it is giving a warning saying: $ name not found when i run the meteor command. but the functionality works fine.

Can you help me how to solve this?


#2

I’m not quite sure what you mean here. Can you post the exact error message you’re getting?


#3

I removed the errors by installing jquery through npm and import it:

import * as $ from 'jquery';

Meteor will use the newly installed jquery as the default after you have installed it.


#4

If you’re not actually replacing jQuery,

import { $ } from 'meteor/jquery';

is what works for me.


#5

Thanks for the reply. But it is saying “meteor/jquery” module not found.


#6

It is saying can’t find module jquery

Thanks.


#7

Check the packages file in .meteor folder? If there is a row for jquery there, there should be no problems. Post some descriptive error logs please.