-
Notifications
You must be signed in to change notification settings - Fork 757
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
Emitter Error on Reload with Multiple Instances #511
Comments
On a personal note, I'm trying to push Gulp and BrowserSync forward at my company as a way to automate and simplify our front end tasks from day->day. My end goal here is to be able to have a Drupal site and the prototype side by side, on multiple browsers, so that changes can be compared and confirmed instantly. There's a lot of interest, but my last several hours of trying to circumvent this error have been fruitless. I hope the bug report helps! |
This bug is now fixed, but looking at your gulpfile, where you are calling gulp.watch('_site/js/*.js').on('change', function (){
bs1.reload();
bs2.reload();
}); and the same in the jekyll task /**
* Rebuild Jekyll & do page reload
*/
gulp.task('jekyll-rebuild', ['jekyll-build'], function () {
bs1.reload();
bs2.reload();
}); |
npm install browser-sync@2.2.4 --save-dev :) |
Sorry, that was an artifact from a partial revert to get it back to working order. Thanks much for the information and for the quick bugfix! |
Updated version tested and working perfectly, thanks! |
👍 |
Operating System: OSX 10.9.5
NodeJS Version: v0.12.0
NPM Version: 2.5.1
BrowserSync Version: 2.2.3
Gulpfile Contents:
Error experience: When I run the default Gulp task, two windows open and both report that they are connected to BrowserSync. I can confirm this behavior by removing reload from the default Compass process and calling
bs1.notify('bs1');
andbs2.notify('bs2);
, which output to the correct windows. However, whenever I attempt to call bs1.reload() in any way, the reload fails with the below error message.Error Message:
[21:42:15] Using gulpfile ~/Sites/project/gulpfile.js
[21:42:15] Starting 'browser-sync'...
[21:42:15] Finished 'browser-sync' after 15 ms
[21:42:15] Starting 'compass'...
[21:42:15] Starting 'jekyll-build'...
[21:42:15] Starting 'watch'...
[21:42:15] Finished 'watch' after 22 ms
[21:42:15] gulp-compass: Running command: /usr/bin/bundle exec compass compile /Users/wagner/Sites/project /Users/wagner/Sites/project/_sass/main.scss --no-line-comments --relative-assets --debug-info --css-dir _site/css --sass-dir _sass
[BS] Access URLs:
UI External: http://192.168.1.6:3011
[BS] Serving files from: _site
[BS] Access URLs:
UI External: http://192.168.1.6:3013
[BS] Serving files from: _site
Configuration file: /Users/wagner/Sites/project/_config.yml
Source: /Users/wagner/Sites/project
Destination: /Users/wagner/Sites/project/_site
Generating...
/Users/wagner/Sites/project/node_modules/browser-sync/lib/public/reload.js:14
emitter.emit("file:changed", {
^
TypeError: Cannot read property 'emit' of undefined
at emitReload (/Users/wagner/Sites/project/node_modules/browser-sync/lib/public/reload.js:14:16)
at Transform.reload._transform (/Users/wagner/Sites/project/node_modules/browser-sync/lib/public/reload.js:72:29)
at Transform._read (_stream_transform.js:179:10)
at Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at Transform.Writable.write (_stream_writable.js:217:11)
at write (/Users/wagner/Sites/project/node_modules/gulp-compass/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
at flow (/Users/wagner/Sites/project/node_modules/gulp-compass/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
at DestroyableTransform.pipeOnReadable (/Users/wagner/Sites/project/node_modules/gulp-compass/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: