Menu icon Foundation
jQuery not defined errors since upgrading to Foundation 5.2.0

I am getting jQuery errors since upgrading Foundation from 5.0.2 to 5.2.0 (via bower upgrade). These are the errors I am receiving.

Uncaught ReferenceError: jQuery is not defined
Uncaught ReferenceError: $ is not defined

I am using browserify2 grunt plugin to process my javascript files. Here's the browserify grunt configuration.

browserify2: {
  compile: {
    entry: './js/app.js',
    compile: './scripts/app.js'
  }
},
            

         

Here's the js/app.js itself:

var $ = {},
  jQuery = $ = require('../bower_components/jquery/dist/jquery'),
  modernizr = require('../bower_components/modernizr/modernizr'),
  foundation = require('../bower_components/foundation/js/foundation'),
  fastclick = require('../bower_components/foundation/js/vendor/fastclick');
            

         

After trying several different things in an attempt to figure out what is causing this error, I found out that if I were to import jQuery 2.0.3 (the version that comes with Foundation 5.0.2) instead of jQuery 2.1.0 (the one distributed with Foundation 5.2.0) in the js/app.js - then the resulting scripts/app.js works! jQuery is successfully loaded within the page and no errors are being reported.

Nothing else has changed in my existing setup except for upgrade to Foundation 5.2.0. So I am wondering why this is happening.

For now I have decided to go with Foundation 5.2.0 (I needed to for this bug fix - https://github.com/zurb/foundation/issues/3802) but have decided to use the older jQuery 2.0.3 version instead with my above Gruntfile.js setup.

Any thoughts?

jQuery not definedfoundation 5.2.0upgradejquery

I am getting jQuery errors since upgrading Foundation from 5.0.2 to 5.2.0 (via bower upgrade). These are the errors I am receiving.

Uncaught ReferenceError: jQuery is not defined
Uncaught ReferenceError: $ is not defined

I am using browserify2 grunt plugin to process my javascript files. Here's the browserify grunt configuration.

browserify2: {
  compile: {
    entry: './js/app.js',
    compile: './scripts/app.js'
  }
},
            

         

Here's the js/app.js itself:

var $ = {},
  jQuery = $ = require('../bower_components/jquery/dist/jquery'),
  modernizr = require('../bower_components/modernizr/modernizr'),
  foundation = require('../bower_components/foundation/js/foundation'),
  fastclick = require('../bower_components/foundation/js/vendor/fastclick');
            

         

After trying several different things in an attempt to figure out what is causing this error, I found out that if I were to import jQuery 2.0.3 (the version that comes with Foundation 5.0.2) instead of jQuery 2.1.0 (the one distributed with Foundation 5.2.0) in the js/app.js - then the resulting scripts/app.js works! jQuery is successfully loaded within the page and no errors are being reported.

Nothing else has changed in my existing setup except for upgrade to Foundation 5.2.0. So I am wondering why this is happening.

For now I have decided to go with Foundation 5.2.0 (I needed to for this bug fix - https://github.com/zurb/foundation/issues/3802) but have decided to use the older jQuery 2.0.3 version instead with my above Gruntfile.js setup.

Any thoughts?