title: Gulp 4 - Tasks not finished - Gulpfile.js Browsersync
body: <p>I'm a bit stuck with changing my old Gulp 3 Gulpfile to work in Gulp 4.</p>
  
  <p>I have got to a point where it all seems to work except that the default and serve tasks are not marked as finished in powershell.</p>
  
  <p>How can I unblock the code and allow them to finish correctly please?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var gulp        = require('gulp');
  var browserSync = require('browser-sync').create();
  var sass        = require('gulp-sass');
  
  // Compile sass into CSS &amp; auto-inject into browsers
  gulp.task('sass', function() {
      return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'])
          .pipe(sass())
          .pipe(gulp.dest("src/css"))
          .pipe(browserSync.stream());
  });
  
  // Move the javascript files into our /src/js folder
  gulp.task('js', function() {
      return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js'])
          .pipe(gulp.dest("src/js"))
          .pipe(browserSync.stream());
  });
  
  // Static Server + watching scss/html files
  gulp.task('serve', gulp.series('sass', function() {
  
      browserSync.init({
          server: "./src"  
      });
  
      gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], gulp.series('sass'));
      gulp.watch("src/*.html").on('change', browserSync.reload);
  }));
  
  gulp.task('default', gulp.parallel('js', 'serve'));</code></pre>
  </div>
  </div>
  </p>