BrowserSync couldn’t exit a Gulp task if there’s a server configured
See original GitHub issueDetails
I’m trying to run a local server and take a screenshot of a page using pageres, but BrowserSync couldn’t exit()
a Gulp task if there’s a server
configured.
Steps to reproduce
npm install gulp pageres browser-sync
touch gulpfile.js
with contents belowgulp one
andgulp two
, compare results
const gulp = require('gulp');
const pageres = require('pageres');
const sync = require('browser-sync').create();
gulp.task('server-one', () => {
sync.init();
});
gulp.task('server-two', () => {
sync.init({
server: {
baseDir: '.'
}
});
});
gulp.task('pageres', () => {
return new pageres()
.src('localhost:3000', ['1024x640'], {
crop: true,
scale: 2,
filename: 'localhost'
})
.dest('.')
.run()
.then(() => sync.exit());
});
gulp.task('one', ['server-one', 'pageres']);
gulp.task('two', ['server-two', 'pageres']);
The only difference between one
and two
is
server: {
baseDir: '.'
}
But in two
case BS doesn’t exit task.
Versions
- Browsersync 2.11.2
- Node v5.10.0
- Npm v3.8.3
Affected platforms
- OS X
Use-case
- Gulp
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Browsersync options
These are all the options that you can configure when using Browsersync. Create a single object and pass it as the first argument...
Read more >browserSync.reload doesn't execute using Gulp task
I found out that if I put gulp task 'start-server' in 'watch-sass.js' file instead of separating it to his own file, it works....
Read more >Gulp v4 - Sass and BrowserSync setup - YouTube
In this video I look at how we can setup a gulp build that will compile Sass for us, and automatically sync all...
Read more >How to Wire Up Ruby on Rails and AngularJS as a Single ...
I've tried to do Angular projects with full-blown Rails, but I end up with ... If you have a Rails server running on...
Read more >BrowserSync/browser-sync - Gitter
Using gulp-nodemon with browser-sync Some people want to use browser-sync. That's totally fine, just start browser sync in the same task as nodemon({})...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is actually an issue with the socket.io server. Once a browser is connected even a single time, the tear-down logic within socket.io or engine.io is not running as expected. You can prove the by running Browsersync with open:false and then calling bs.exit() after a few seconds. On Sat, 29 Oct 2016 at 11:50, tcme notifications@github.com wrote:
I’m running into the same problem. I presume it was never fixed?