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

Browser reload in image watcher is broken. #1286

Closed
pixelbrad opened this issue Jun 23, 2018 · 1 comment
Closed

Browser reload in image watcher is broken. #1286

pixelbrad opened this issue Jun 23, 2018 · 1 comment

Comments

@pixelbrad
Copy link
Contributor

pixelbrad commented Jun 23, 2018

How can this bug be reproduced?

  1. npm start
  2. Copy an image into src/assets/images/
  3. Browser will reload this time.
  4. Copy another image into src/assets/images/
  5. Browser will not reload this time or any other time after this.

What did you expect to happen?

I expect the browser to reload every time I copy at least 1 image into src/assets/images/.

What happened instead?

The first time the browser reloaded, my command line logged the following:

[15:08:56] Starting 'images'...
[15:08:56] Finished 'images' after 39 ms
[15:08:56] Starting '<anonymous>'...
[Browsersync] Reloading Browsers...

<anonymous> never finishes. Now any time I go to copy an image into the assets folder, nothing happens. The images wont even copy.

Please List the Following:

  • OS & version: Windows 10 Enterprise, Version 1709, OS Build 16299.492
  • Node version (node -v) [Node v4+ is required] : v9.3.0
  • FoundationPress version (see line 3 in package.json): 2.10.4
  • Foundation version (found in node_modules/foundation-sites/package.json) : 6.4.3

Include Test Case (if applicable):

Not applicable. Just follow the few steps in how this bug can be reproduced.

Proposed Solution:
In gulpfile.babel.js, change

gulp.watch('src/assets/images/**/*', gulp.series(images, browser.reload)); [line 232]
to
gulp.watch('src/assets/images/**/*', gulp.series(images, reload));

Misc Notes:

Also, if you plan on keeping the svg task around, probably you should apply the same solution. Not sure why you have a separate task for svgs anyway, since imagemin can handle svgs (even since 2.4.0). Consider updating repo's imagemin version to latest (4.1.0 at time of writing).

@CobraClutch
Copy link

I've had this issue for awhile, I'm glad I'm not the only one. I always have to kill/restart the watch task to get the dist folder to update with newly added images.

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