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

HTML watch stuck on "Reloading Browsers..." #54

Closed
CoreyCole opened this issue Jun 13, 2016 · 2 comments
Closed

HTML watch stuck on "Reloading Browsers..." #54

CoreyCole opened this issue Jun 13, 2016 · 2 comments

Comments

@CoreyCole
Copy link

Description - Problem

Off a fresh generation of angular1 with gulp, typescript, sass, and systemJS I noticed changes to HTML files were not triggering a browserSync refresh every time. When I looked into it further, it would trigger a refresh the first time I made any changes to HTML files, but any subsequent changes would not trigger a refresh. To view those changes I had to ctrl + c and npm start serve.

Solution

I found this broswerSync issue that looked similar to my problem and tried the proposed solution there. I solved my problem by making changes to the watch function in gulpfile.js.

Before

function watch(done) {
  gulp.watch(conf.path.src('**/*.html'), browserSync.reload);
  gulp.watch([
    conf.path.src('**/*.scss'),
    conf.path.src('**/*.css')
  ], gulp.series('styles'));
  gulp.watch(conf.path.src('**/*.ts'), gulp.series('scripts'));
  done();
}

After

function watch(done) {
  gulp.watch(conf.path.src('**/*.html'), function(done) {
    browserSync.reload();
    done();
  });
  gulp.watch([
    conf.path.src('**/*.scss'),
    conf.path.src('**/*.css')
  ], gulp.series('styles'));
  gulp.watch(conf.path.src('**/*.ts'), gulp.series('scripts'));
  done();
}

Let me know if I'm not seeing any consequences of this change. I tested changes to .scss and .ts files after and they still refreshed the browser normally.

Error Message & Stack Trace

After editing an HTML file more than once:

[15:13:58] Starting '<anonymous>'...
[BS] Reloading Browsers...

Config

{
  "generator-fountain-angular1": {
    "version": "0.5.3",
    "props": {
      "framework": "angular1",
      "modules": "systemjs",
      "js": "typescript",
      "css": "scss",
      "resolved": "/usr/local/lib/node_modules/generator-fountain-webapp/node_modules/generator-fountain-angular1/generators/app/index.js",
      "namespace": "fountain-angular1",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "skip-cache": false,
      "skip-install": false,
      "sample": "todoMVC"
    }
  }
}

Environment

Node.js v5.9.0
darwin 15.4.0
yo --version 1.8.4
npm --version 3.7.3
@zckrs
Copy link
Member

zckrs commented Jun 14, 2016

Hi @CoreyCole,

First thank you to respect the issue template. I think you are the first 👏
Second your issue is already reported #50 and fixed FountainJS/generator-fountain-gulp#38.

We have not yet released a new version.
Keep this issue open to avoid other duplicate

@micaelmbagira
Copy link
Member

0.5.4 has just been released, it should be fixed. Can you confirm ?

@zckrs zckrs closed this as completed Jun 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants