Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tunnel issue #1370

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix tunnel issue #1370

wants to merge 1 commit into from

Conversation

mcampa
Copy link

@mcampa mcampa commented Apr 28, 2017

Apparently BrowserSync tries to refresh the browser before bs.io is defined causing the following issues:

The issue happens when option tunnel: true

bs.init({
    open: false,
    port: 3000,
    files:
    [ '/Users/mario.campa/stencil/templates',
        '/Users/mario.campa/stencil/lang' ],
    watchOptions:
    { ignoreInitial: true,
        ignored:
        [ '/Users/mario.campa/stencil/assets/scss',
            '/Users/mario.campa/stencil/assets/less',
            '/Users/mario.campa/stencil/assets/css',
            '/Users/mario.campa/stencil/assets/dist' ] },
    proxy: 'localhost:3001',
    tunnel: true,
});
/usr/local/lib/node_modules/browser-sync/node_modules/rx/dist/rx.js:77
    throw e;
    ^

TypeError: Cannot read property 'sockets' of undefined
    at EventEmitter.file:reload (/usr/local/lib/node_modules/browser-sync/lib/internal-events.js:17:18)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at /usr/local/lib/node_modules/browser-sync/lib/internal-events.js:100:35
    at Array.forEach (native)
    at AnonymousObserver._onNext (/usr/local/lib/node_modules/browser-sync/lib/internal-events.js:98:25)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/local/lib/node_modules/browser-sync/node_modules/rx/dist/rx.js:1828:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/local/lib/node_modules/browser-sync/node_modules/rx/dist/rx.js:1762:31)
    at AnonymousObserver.tryCatcher (/usr/local/lib/node_modules/browser-sync/node_modules/rx/dist/rx.js:63:31)
    at AutoDetachObserverPrototype.next (/usr/local/lib/node_modules/browser-sync/node_modules/rx/dist/rx.js:5883:51)

This fixes the issue and the tunnel is started with no issues

@coveralls
Copy link

coveralls commented Apr 28, 2017

Coverage Status

Coverage decreased (-0.003%) to 95.4% when pulling c49ca6c on mcampa:tunnelBug into cbe2ccb on BrowserSync:master.

@mcampa
Copy link
Author

mcampa commented May 2, 2017

anyone wants to comment on this issue?

@shakyShane
Copy link
Contributor

@mcampa looks great thanks! I just need to create a test-case for it :)

@junedkazi
Copy link

Do we have any update on this PR ?

@junedkazi
Copy link

@shakyShane any updates on this PR ?

junedkazi pushed a commit to junedkazi/browser-sync that referenced this pull request Jan 15, 2018
junedkazi pushed a commit to junedkazi/browser-sync that referenced this pull request Jan 15, 2018
@bookernath
Copy link

@shakyShane just wanted to follow up on this - we'd love to move back to using canonical browser-sync and this is our only reason for maintaining a fork today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants