I get the message 'Disconnected from BrowserSync' almost immediately after running gulp. Here is my gulpfile.js
var gulp = require('gulp');
var sass = require('gulp-sass');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('sync', function() {
browserSync.init({
browser: "chrome",
proxy: "hmgcsc.app"
});
gulp.watch('sass/*.scss', ['sass']);
gulp.watch("app/**/*.html").on('change', reload);
gulp.watch("app/**/*.js").on('change', reload);
});
gulp.task('sass', function() {
return gulp.src('sass/*.scss')
.pipe(sass({
includePaths: [
'node_modules/susy/sass' //required for sass
]
}))
.pipe(gulp.dest('css'))
.pipe(reload({stream: true}));
});
gulp.task('default', ['sync']);
Every once in a while, it will work correctly, but never for longer than 30 seconds. The CLI acts like everything is still working correctly. It displays no errors and notifies me of file changes.
Has anyone else had this issue?
It looks like he just fixed whatever the bug was in 2.7.1. Updating Browser-sync fixed the issue for me :)