browser-sync stops working

Created on 5 May 2016  路  15Comments  路  Source: BrowserSync/browser-sync

Issue details

This has been working all along, I was running (browser-sync version 2.10.1, express 4.13.3, node 5.8.0)
Not sure when this stopped working. I did recently upgrade to node 6.0.0

Now it's taking a long time(like minutes) for the browser-sync to open up chrome (chrome Version 50.0.2661.94 (64-bit)). When chrome finally opens, nothing gets loaded, it's a blank as if it can't connect to the server. I even tried the latest browser-sync version 2.12.5 but the same behavior.

Steps to reproduce/test case

_Please provide necessary steps for reproduction of this issue, or better the
reduced test case (without any external dependencies)_.

Please specify which version of Browsersync, node and npm you're running

  • Browsersync [ 2.12.5 ]
  • Node [ 6.0.0 ]
  • Npm [ 3.8.6 ]

    Affected platforms

  • [ ] linux

  • [ ] windows
  • [X ] OS X
  • [ ] freebsd
  • [ ] solaris
  • [ ] other _(please specify which)_

    Browsersync use-case

  • [ ] API

  • [X ] Gulp
  • [ ] Grunt
  • [ ] CLI

    If CLI, please paste the entire command below

{cli command here}

for all other use-cases, (gulp, grunt etc), please show us exactly how you're using Browsersync

{Browsersync init code here}

My config setup in gulp

const DEFAULT_PORT = 8008;
const SECURED_PORT = 8010;

const serverOptions = {
  root: 'src',
  port: 8008,
  host: 'http://localhost:',
  livereload: true
};

function runTdd () {
  return runSequence(tasks.startWebServer, tasks.browserSync);
}

// TDD task
gulp.task(tasks.tdd, () => {
  serverOptions.port = DEFAULT_PORT;
  serverOptions.host = 'http://localhost:';
  runTdd();
});

// TDD https task
gulp.task(tasks.tddHttps, function () {
  serverOptions.port = SECURED_PORT;
  serverOptions.host = 'https://localhost:';
  runTdd();
});

// starts web server
//gulp.task(tasks.startWebServer, () => express.run(['server.js']));
gulp.task(tasks.startWebServer, function () {
  //connect.server(serverOptions);
  return express.run([
    'server.js'
  ]);
});

// Browser sync
gulp.task(tasks.browserSync, () => {
  browserSync.init(null, {
    proxy: serverOptions.host + serverOptions.port + '/ng2-examples',
    files: ["src/**/*.*"],
    browser: "google chrome",
    port: 8009,
  });
});

Like I said this was working until recently. Thanks.

Most helpful comment

@tayfunerbilen and @mifantwan it seems that the issue is node 11

https://github.com/BrowserSync/browser-sync/issues/1626

All 15 comments

Seeing the same behaviour, with a similar setup, since two or three days ago.

I have a similar issue. This was working for me just fine last week. Just out of curiosity, have you guys just recently started using variables/constants for port numbers? The only significant change I made to my gulpfile was the addition of variables for this specific purpose.

This doesn't seem to be a decent explanation, however, because I'm able to connect other devices to the external IP when using my Mac, but not while using my PC (Windows 10).

Same problem. I'm using the exact same setup and configuration as before, but it seems to have stopped working after I updated to Node 6.1.0.

Client is throwing the following:

browser-sync-client.2.12.5.js:1 Uncaught SyntaxError: Unexpected token <

Edit: seemed to have fixed itself after installing bs 2.12.8.

Same issue, hasn't fixed itself in BrowserSync v2.12.8.

I think it's some sort of a caching issue perhaps. On my laptop, it now works intermittently. When a new tab opens with the project, I can see the browser is still trying to load 2.12.5, but then after I do a manual refresh with the console open it suddenly works for the rest of the session.

On my other computer, where I updated BrowserSync prior to using it I did not have this issue and it seems to be working fine with 2.12.8.

I think the key word is intermittently, I'll observe 1-2 loads, but not consistently or completely.

exactly the same problem

Same problem here.

  • I tested it with Node v4.4.4 and v6.1.0 but no luck. Went back to v0.10.29. Success! Colleage tested with v5.4.1 and it does also work
  • Problem does only occure if proxy is pointing to another Node server. If it points to an Apache, it does work

I have the issue too.

I run against node v5.12.0, browser-sync v2.13.0 in vagrant box on windows with proxy setting. IE, Firefox is normally connected to BrowserSync except Chrome

After 2 years ago, same issue.. it is working for a while and then stopping.
is there any solution?

i have same issue on my sierra notebook, i write many gulp configuration but still not work

@tayfunerbilen and @mifantwan it seems that the issue is node 11

https://github.com/BrowserSync/browser-sync/issues/1626

@waltercruz i'm using node 10.7.0 ...sometimes browser sync work for many reload, but sometimes it stop work at 2 - 3 times reload. i'll try downgrade node version, tq

ok, I downgraded my nodejs version from 11 to 10.13, and it's working now.

Exact same problem with v12.13.1 .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sedubois picture sedubois  路  3Comments

npearson72 picture npearson72  路  3Comments

ilianaza picture ilianaza  路  4Comments

ericmorand picture ericmorand  路  3Comments

ngryman picture ngryman  路  3Comments