Kyle Bolton
Kyle Bolton

Reputation: 23

'jQuery is not defined' in Meteor app?

Seem to be getting a strange error after downloading semantic-ui and I can't get it to run when I've chosen what I do, and do not want in my custom.semantic.json file. I've tried also downloading/installing the jQuery package to my directory with no joy. Error message below.

>/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
                        throw(ex);
                              ^

> ReferenceError: jQuery is not defined
>     at app/definitions/behaviors/api.js:1081:5
>     at app/definitions/behaviors/api.js:1083:3
>     at /Users/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:222:10
>     at Array.forEach (native)
>     at Function._.each._.forEach (/Users/Kyle/.meteor/packages/meteor-tool/.1.1.3.1wysac9++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/Kyle/Desktop/portfolio/.meteor/local/build/programs/server/boot.js:117:5
> Exited with code: 8 Your application is crashing. Waiting for file
> change.

Upvotes: 2

Views: 3449

Answers (1)

user773156
user773156

Reputation:

In Meteor, this happens when custom.semantic.json is inside the root's lib/ folder. Thus, Semantic-UI generates all its folders and files in lib/ which is loaded before any of its core dependencies, such as jQuery.

The solution is to place custom.semantic.json in an app folder, such as client/lib/semantic-ui/.

Upvotes: 11

Related Questions