SyntaxError: class is a reserved identifier
TypeError: $(...).foundation is not a function

I thought it was WordPress’s fault for not using $ for jQuery, but since I have wrapped my foundation function with namespace, I don’t think this is an issue.

(function($) {
$(document).foundation();
})(jQuery);

After a quick Google search, I found others to have the same problem. It turns out that Essential pack in Foundation 6’s download page has a glitch. It gives you ES6 version of foundation.js instead of ES5.

The Solution

We just need to transpile Foundation 6 ES6 version to ES5 using BabelJS, and it will be fixed 🙂