Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

JS error in Safari #874

Closed
goodbeardigi opened this issue Aug 25, 2016 · 5 comments
Closed

JS error in Safari #874

goodbeardigi opened this issue Aug 25, 2016 · 5 comments

Comments

@goodbeardigi
Copy link

Hi,

I've got a site using v2.6.1 and i'm getting the following error in JS:
[Error] SyntaxError: Unexpected token ')' (anonymous function) (foundation.js:1079)

Line 1079 is:
$(window).on('resize.zf.mediaquery', () => {

I use FoundationPress a lot and have never had this problem before, I have sites on v2.1.0 and v2.3.0 so i'm wondering if it's just a bug in this version?

If so what's the easiest way for me to update my theme version, while keeping all of my custom work?

The error can be seen on any page at https://bigstartassemblies.org

Thanks,
James

@olefredrik
Copy link
Owner

Hi @Cobbalobb ,

Did you make any changes to your gulpfile.js?

The foundation.util.mediaQuery.js needs to be included after the foundation.core.js.

Do you get any errors when running npm run build ?

@goodbeardigi
Copy link
Author

Hi @olefredrik

Thanks for the reply.

No changes to the gulpfile.js, that bit in question looks like:
'assets/components/foundation-sites/js/foundation.core.js', 'assets/components/foundation-sites/js/foundation.util.*.js',

So that seems ok?

npm run build runs fine, the only thing of question is:
(node:15147) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

Thanks,
James

@olefredrik
Copy link
Owner

I found this similar issue.

What does your package.json file look like? If you're on a recent version of FP, Babel Core / preset / plugins should be listed under devDependencies. Can you check your node_modules folder and look for the babel folders there? If they're not there, try npm install.

@goodbeardigi
Copy link
Author

Babel is in the package.json and in my node_modules folder.

I think I found the fix though, it was to do with babel. I've added the following to package.json and it seems to have done the trick:
"babel": { "presets": ["es2015"], "compact": true }

Thanks for your help and continued support of the framework, I use it a load!

@ScottyZA
Copy link

Had the same bug issue and @Cobbalobb solution solved it. Should we not add this to the repo?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants