gulp-community / gulp-livereload

gulp plugin for livereload
768 stars 67 forks source link

Error on livereload.js #55

Closed lexxcode closed 9 years ago

lexxcode commented 9 years ago

Hello.

I have a problem on new version gulp-livereload. When I edit file and save him, gulp initializes reload page, but page don't reloaded, because livereload.js can not be executed due to an internal error:

Uncaught TypeError: Cannot read property 'match' of undefined  livereload.js:503

Alt text

test gulpfile.js

var gulp = require('gulp'),
    livereload = require('gulp-livereload');

gulp.task('livereload', function() {
    livereload.changed();
});

gulp.task('watch', function() {
    livereload.listen();
    gulp.watch('./**/*.html', ['livereload']);
});

gulp.task('default', ['watch']);

gulp-livereload v2.1.1 worked well

Thanks for any help :)

cyrusdavid commented 9 years ago

Please pass a value to .changed().

gulp.watch('./**/*.html', ['livereload']);

to

gulp.watch('./**/*.html', livereload.changed);

would work.

lexxcode commented 9 years ago

Oh, nice! It's working :) Thank you very much :)

dman777 commented 8 years ago

I have this happening with

   gulp.watch([
        compilePath + '/**/*',
        compilePath + '/application.css',
        compilePath + '/templates.js'
    ]).on('change',function() { setTimeout(plugins.livereload.changed, 2000)});