gimm / gulp-express

gulp plugin for express
56 stars 26 forks source link

LiveReload breaks on server restart #35

Closed thesciz closed 9 years ago

thesciz commented 9 years ago

Whenever any code changes are noticed in the following files:

gulp.watch(['app.js', 'routes/**/*.js', 'app/**/*.js'], [server.run]);

Livereload stops working in the browser:

WebSocket connection to 'ws://192.168.1.60:35729/livereload' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Is there a way to simply restart the gulp process or to circumvent this error?

gimm commented 9 years ago

I've verified this problem, my suggestion is:

server.run();
gulp.watch(['app.js', 'routes/**/*.js', 'app/**/*.js'], server.notify);

this works for me.

mjancarik commented 9 years ago

I have same problem..

It doesn't solve my problem, where I have isomorphic application and I need to restart server and notify about changes for reload.

thesciz commented 9 years ago

Hey gimm,

Still no dice. Notify seems to just trigger the livereload of static assets, but won't restart the Node server itself. server.run accomplishes this, but livereload is broken until I quit and restart the gulp process.

gimm commented 9 years ago

@thesciz @Microx the new release v0.3.0 should solve this problem. please let me know if it doesn't.

mjancarik commented 9 years ago

Hi gimm,

v0.3.0 resolve my problem. Now everything working right.

Thanks

gimm commented 9 years ago

@Microx np, thanks for feedback!