Menu icon Foundation
Error using foundation.core.js and Equalizer plug-in

I'm concatenating Foundation 6's foundation.core.js, util.mediaQuery.js, and equalizer.js files. In the source code, the source order is jquery first, then foundation.core.js, util.mediaQuery.js, and the plug-in file, per the documentation. I also compile their JS to ECMAScript 2015, using Babel per Zurb's docs.

 

This error occurs with util.mediaQuery.js included:

Uncaught TypeError: Foundation.onImagesLoaded is not a function(…)

 

This error occurs without util.mediaQuery.js included:

Uncaught TypeError: Cannot read property '_init' of undefined

 

I'm not sure it's relevant to include the snippets these errors reference. According to the documentation for Equalizer: "The file foundation.equalizer.js must be included in your JavaScript to use this plugin, along with foundation.core.js.".

Then, on a different page within the docs is this nugget: "if you're only using certain plugins, know that they all require foundation.core.js and foundation.util.mediaQuery.js to be loaded first".

Despite this nebulous direction, one of the two above scenarios should produce a functioning plug-in rather than an error.

Any insight as to why it's occurring is greatly appreciated.

Equalizer

I'm concatenating Foundation 6's foundation.core.js, util.mediaQuery.js, and equalizer.js files. In the source code, the source order is jquery first, then foundation.core.js, util.mediaQuery.js, and the plug-in file, per the documentation. I also compile their JS to ECMAScript 2015, using Babel per Zurb's docs.

 

This error occurs with util.mediaQuery.js included:

Uncaught TypeError: Foundation.onImagesLoaded is not a function(…)

 

This error occurs without util.mediaQuery.js included:

Uncaught TypeError: Cannot read property '_init' of undefined

 

I'm not sure it's relevant to include the snippets these errors reference. According to the documentation for Equalizer: "The file foundation.equalizer.js must be included in your JavaScript to use this plugin, along with foundation.core.js.".

Then, on a different page within the docs is this nugget: "if you're only using certain plugins, know that they all require foundation.core.js and foundation.util.mediaQuery.js to be loaded first".

Despite this nebulous direction, one of the two above scenarios should produce a functioning plug-in rather than an error.

Any insight as to why it's occurring is greatly appreciated.

Wesley Picotte over 3 years ago

Why is it so difficult to get support on buggy stuff with Foundation 6? I appreciate the framework, but it's very frustrating to apply it and get crickets as a response to issues that shouldn't occur in the first place.

Jethin over 3 years ago

Hey there. I was experiencing the same error and I believe I've figured out a workaround. Bug ticket about the error. Solution: load foundation.util.timerAndImageLoader.js [<-- v. 6.2.3] file after foundation.js in your project. This remedied the Equalizer js error on my site. According to the ticket above I believe a fix for this issue may be in the works for Foundation v. 6.3. Good luck!

Wesley Picotte over 3 years ago

 Jethin, thanks. Solved my issue. Good idea re: checking the bug tickets.