HTML/CSS JavaScript Programming WordPress WordPress Themes

[Foundation 6 & WordPress] SyntaxError: class is a reserved identifier class

I got this error when trying to use foundation 6’s JavaScript from Essential pack (downloaded from here:

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($) {



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 🙂

You can find ES5 version of foundation.js here:

Have a nice day !

Leave a Reply

Your email address will not be published.