Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BrowserSync continual GET using Express/Gulp

I'm running an Express server and am using browserSync to watch for changes. When I run npm start, it kicks off a gulp task that runs:

// Server task
gulp.task('server', function(cb) {

  // We use this `called` variable to make sure
  // the callback is only executed once
  var called = false;

  return nodemon({
    script: 'server.js',
    watch: ['server.js', 'app/**/*.js', 'config/**/*.js']
  })
  .on('start', function onStart() {
    if (!called) {
      cb();
    }
    called = true;
  })
  .on('restart', function onRestart() {

    // Also reload the browsers after a slight delay
    setTimeout(function reload() {
      browserSync.reload({
        stream: false
      });
    }, 500);
  });
});

// BrowserSync
gulp.task('browser-sync', ['server'], function() {
    browserSync.init({

      // All of the following files will be watched
      files: ['public/**/*.*'],

      // Tells BrowserSync on where the express app is running
      proxy: 'http://localhost:3000',
      port: 4000,
      open: false,
      notify: false,
      logPrefix: project.name,
      logConnections: false,
      logLevel: 'silent'
    });
  });

However, in the terminal window, it keeps on displaying the following:

GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521010-28291 200 10.482 ms - -
GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521032-28292 200 10.573 ms - -
GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521053-28293 200 8.754 ms - -
GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521082-28294 200 7.013 ms - -
GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521110-28295 200 8.339 ms - -
GET /browser-sync/socket.io/?EIO=3&transport=polling&t=1428091521134-28296 200 12.367 ms 

What is causing this? How can I fix this?

like image 308
cusejuice Avatar asked Apr 03 '15 20:04

cusejuice


1 Answers

I was facing the same issue. Exiting powershell and restarting firefox fixed the issue.

Hope this helps!

like image 105
Aakash Avatar answered Sep 20 '22 18:09

Aakash