Quramy / electron-connect

Livereload tool for Electron
https://www.npmjs.com/package/electron-connect
340 stars 54 forks source link

Fails to electron.reload() when preceded by other gulp tasks #71

Open darkurse opened 7 years ago

darkurse commented 7 years ago

Hi, I'm having an issue reloading successfully my electron app after a scss change. As you can imagine, I need to transform my scss resource into a css file, which implies a gulp task prior reloading the electron app.

In partitioning the issue I noticed that any gulp task prior electron.reload was resulting in a crash. ie: following 'watch' task triggers 'noop' then 'reload:renderer' tasks

gulp.task('watch', function () {
    gulp.watch([
        path.join(conf.paths.src, '/app/**/*.css'),
        path.join(conf.paths.src, '/app/**/*.scss')
    ], function (event) {

        gulp.start('noop')
            .pipe('reload:renderer')
    })
})

gulp.task('noop', function () {
});

gulp.task('reload:renderer', function (done) {
  // Reload renderer process
  electron.reload();
  done();
});

Am I missing something ?

Jaeiya commented 7 years ago

+1 I'm having the same issue. I watch for changes and as soon as a file is changed, I get the following when electron tries to reload: TypeError: ids.forEach is not a function

edit Though I have to add, even if I update a css file manually, I still get the same error. My client is being created in the browser process. I'm using Electron version 1.4.15

altsanz commented 6 years ago

@darkurse Did you manage to solve this. I get an ECONNRESET on gulp from NPM when reloading.