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

JS not being compiled properly during default Gulp task #1204

Closed
kculmback opened this issue Jan 11, 2018 · 3 comments
Closed

JS not being compiled properly during default Gulp task #1204

kculmback opened this issue Jan 11, 2018 · 3 comments

Comments

@kculmback
Copy link

How can this bug be reproduced?

  1. Download FoundationPress
  2. Install dependencies
  3. Run default gulp task

What happened instead?
Received following console error:

Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0_jquery___default(...)(...).foundation is not a function
    at Object.<anonymous> (app.js:11)
    at __webpack_require__ (bootstrap 406039efd30a19d74f01:19)
    at Object.defineProperty.value (foundation.tabs.js:498)
    at __webpack_require__ (bootstrap 406039efd30a19d74f01:19)
    at bootstrap 406039efd30a19d74f01:62
    at bootstrap 406039efd30a19d74f01:62

I don't receive the error when running the gulp build task with the --production flag.

I also had similar issues trying to use lib/foundation-explicit-pieces instead of loading in all of Foundation.js. However, I received two different errors:

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
    at Object.<anonymous> (foundation-explicit-pieces.js:103)
    at Object.module.exports (foundation-explicit-pieces.js:103)
    at __webpack_require__ (bootstrap 0d911ee6ef9f806bcc2d:19)
    at Object.<anonymous> (foundation.tabs.js:498)
    at __webpack_require__ (bootstrap 0d911ee6ef9f806bcc2d:19)
    at Object.defineProperty.value (foundation.tabs.js:498)
    at __webpack_require__ (bootstrap 0d911ee6ef9f806bcc2d:19)
    at bootstrap 0d911ee6ef9f806bcc2d:62
    at bootstrap 0d911ee6ef9f806bcc2d:62

And another error referring to using module.exports. I got that error last night though and can't seem to reproduce it currently.

I'm not sure if this makes a difference but I'm using Yarn instead of NPM.

Please List the Following:

  • OS & version: Mac OSX 10.11
  • Node version (node -v) [Node v4+ is required] : 8.9.1
  • FoundationPress version (see line 3 in package.json): 2.10.4
  • Foundation version (found in node_modules/foundation-sites/package.json): 6.4.3

I was able to reproduce this issue on my MacBook Pro and my work iMac.

Any help would be appreciated!

@conorbarclay
Copy link
Contributor

I was getting these issues today all of a sudden as well while running some tests for #1202...I ended up tweaking the gulpfile to fix it: https://github.com/conorbarclay/FoundationPress/blob/master/gulpfile.babel.js

Try that out and let me know how it goes. I want to put together a PR to get this patched up.

@kculmback
Copy link
Author

The gulpfile tweaks seem to fix it! Thanks @conorbarclay

@maciekgrzybek
Copy link

I had same issue, that gulpfile change helped.

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