browser-sync: Google Chrome stuck processing request

When using Browser Sync with gulp I get a stuck processing request in Google Chrome on OSX after saving a html file about 5 times. Safari seems to be OK.

CSS changes appear to be fine as Chrome doesnt hang on them. It only seems to be around updating the html files.

This is my BrowserSync setup…

// BrowserSync proxy
gulp.task('browserSync', function() {
  browserSync.init({
    server: dist
  });
});

// BrowserSync reload all Browsers
gulp.task('browserSync-reload', function () {
    browserSync.reload();
});

gulp.task('serve', ['browserSync','sass','fileinclude','images'], function() {

    gulp.watch("./src/scss/**/*.scss", ['sass']);
    gulp.watch("./src/pages/**/*.html", ['fileinclude']);
    gulp.watch("./dist/**/*.html", ['browserSync-reload']);
});

Has anyone else noticed this problem?

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 2
  • Comments: 37 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I’m still experiencing this problem…

I am having the same issue. For me - I added an XHR request and once I call “document.write(some parsed JSON)” it was creating me that panding request. @shakyShane I’ve created a public repo for you to reproduce the issue: https://github.com/alexcracea/bs-pending-request - note: Just in case you don’t have gulp globally i added support for you to run “npm run gulp” when you’re inside “.npm” folder.

As you can see, the request from url ws://localhost:3002/browser-sync/socket.io/?EIO=3&transport=websocket&sid=TR1X04-6mgbAHe7IAAAH is not being processed. In my case, the browser “loading” icon was appearing only while i call “document.write();”

Not sure if this helps, but I often experience Chrome/Mac OS X just “getting stuck” viewing regular web pages. The way to bring it back to life is to go to chrome://net-internals config page and click on “Close idle sockets” and “Flush socket pools” button (see image below). Then it works fine for another few days. Then I have to repeat the same process again. Pretty annoying.

screen shot 2016-09-26 at 8 33 24 am

Having the same issue on 2.24.6 with gulp. I have browsersync in proxy mode to a backend running on localhost:5000 and noticed a few things:

  • Other browsers (firefox) work just fine
  • Same Chrome in anonymous mode works just fine
  • Normal, non-anonymous, chrome window hangs
  • Hitting the actual backend being proxied to in a separate tab, makes the frozen tab unfreeze and process the request

A little update: Flushing socket pools and closing idle sockets from chrome://net-internals, as suggested by @demisx does resolve the issue when done while the window is hanging.