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

Uncaught SyntaxError: Unexpected token import #1167

Closed
tomhermans opened this issue Nov 24, 2017 · 6 comments
Closed

Uncaught SyntaxError: Unexpected token import #1167

tomhermans opened this issue Nov 24, 2017 · 6 comments

Comments

@tomhermans
Copy link

tomhermans commented Nov 24, 2017

Uncaught SyntaxError: Unexpected token import #1167 in app.js

import $ from 'jquery';

How can this bug be reproduced?

  1. Step one
    load the page with FoundationPress activated
  2. Step two
    check console.
  3. Step three
    mobile menu for instance doesn't work

What did you expect to happen?
that JS gets compiled correctly

What happened instead?
error on line 1

Please List the Following:

  • OS & version:
    Mac OSX 10.11.6

  • Node version (node -v) [Node v4+ is required] :
    node 5.6

  • FoundationPress version (see line 3 in package.json):
    "version": "2.10.4",

  • Foundation version (found in node_modules/foundation-sites/package.json) :
    "foundation-sites@6.4.3",

@colin-marshall
Copy link
Collaborator

@tomhermans does jquery exist in node_modules/jquery? Were there any errors on npm install?

@tomhermans
Copy link
Author

Yes. checked the folder and even re-done npm install. no messages

@colin-marshall
Copy link
Collaborator

colin-marshall commented Nov 26, 2017

@tomhermans I can't reproduce on the same version of node and I'm on the exact same version of macOS. Just to make sure, did you build the theme assets with npm run start and there were no errors in the terminal window?

If dist/assets/js/app.js and src/assets/js/app.js are the exact same then this sounds like the same thing as #1080.

@colin-marshall
Copy link
Collaborator

@tomhermans any update on this issue?

@tomhermans
Copy link
Author

I started over with a fresh FoundationPress and issue is gone. Not really a clue what has changed though..

@colin-marshall
Copy link
Collaborator

@tomhermans that's great! We updated the packages for webpack and babel-loader and also optimized the javascript build/watch tasks in #1169 and #1196. I'm guessing one of these updates were what resolved your issue. Closing this out.

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

2 participants