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

No browser-sync-client.js is loaded and browser-sync with gulp isn't reloading nor injecting any changes and BrowserSync UI isn't showing any current connections #1617

Open
2 of 10 tasks
rpkoller opened this issue Oct 9, 2018 · 2 comments

Comments

@rpkoller
Copy link

rpkoller commented Oct 9, 2018

Issue details

I've set up a package.json file and a gulp.js file, like shown below, in a project folder. When I start Gulp (https://gist.github.com/rpkoller/07e13364a71f7d2560e19692a84f07e6) the site is opening in a new browser window. The tasks are also applied properly so css and js files are generated. Problem is as shown in the gist even that the Browsersync tasks states Reloading Browser... no browser window is reloaded nor are any changes injected into the CSS for the Compass task. If I take a look into the BrowserSync UI there aren't any current connections listed.
bildschirmfoto 2018-10-09 um 12 00 28
even that the page was opened via localhost:3000 in a Chrome as well as a Safari window. And if i search in the DOM for browser-sync-client.js there isn't any loading listed.

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.26.0 ]
  • Node [ 10.11.0 ]
  • Npm [ 6.4.1 ]

Affected platforms

  • linux
  • windows
  • OS X
  • freebsd
  • solaris
  • other (please specify which)

Browsersync use-case

  • API
  • 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

the loaded dependencies in the package.json of the project:

├── browser-sync@2.26.0
├── gulp@3.9.1
├── gulp-autoprefixer@6.0.0
├── gulp-compass@2.1.0
├── gulp-concat@2.6.1
├── gulp-load-plugins@1.5.0
├── gulp-plumber@1.2.0
└── gulp-uglify@3.0.1

the used gulp.js file:

var gulp = require('gulp');
var gulpLoadPlugins = require('gulp-load-plugins');
var plugins = gulpLoadPlugins();
var browserSync = require('browser-sync').create();

var devDomain = "http://mysite.test";
var themePath = "./wp-content/themes/mysite/";
var cssPath = "./wp-content/themes/mysite/css/";
var scssPath = "./wp-content/themes/mysite/scss/";
var jsPath = "./wp-content/themes/mysite/js/";
var jsPathRaw = "./wp-content/themes/mysite/js/raw/";
var mainMin = "main.min.js";
var overtureMin = "overture.min.js";

gulp.task('compass', function(){
	return gulp.src( scssPath + '*.scss' )
	  .pipe(plugins.plumber())
    .pipe(plugins.compass({
      config_file: './config.rb',
	    css: cssPath,
	    sass: scssPath
    }))
		.pipe(plugins.autoprefixer('last 2 versions'))
		.pipe(gulp.dest(cssPath))
		.pipe(browserSync.stream({match: '**/*.css'}));
});

gulp.task('js-overture', function() {
  return gulp.src([
		jsPathRaw + 'vendor/matchmedia.js',
		jsPathRaw + 'vendor/picturefill.js',
    jsPathRaw + 'overture.js'
  ])
    .pipe(plugins.concat(overtureMin))
    .pipe(plugins.uglify())
		.pipe(gulp.dest(jsPath))
		.pipe(browserSync.stream());
});

gulp.task('js-main', function() {
  return gulp.src([
    jsPathRaw + 'vendor/jquery.js',
    jsPathRaw + 'vendor/enquire.js',
    jsPathRaw + 'vendor/jquery.smooth-scroll.js',
    jsPathRaw + 'main.js'
  ])
    .pipe(plugins.concat(mainMin))
    .pipe(plugins.uglify())
		.pipe(gulp.dest(jsPath))
		.pipe(browserSync.stream());
});

gulp.task('js-watch', ['js-overture','js-main'], function (done) {
	browserSync.reload();
	done();
});

gulp.task('watch', function () {

	browserSync.init({
		logLevel: "debug",
		browser: "google chrome",
		open: 'external',
		proxy: devDomain,
		injectChanges: true
	 });

  gulp.watch([scssPath + '**/*.scss'], ['compass']);
	gulp.watch([jsPathRaw + '*.js'], ['js-watch']);
});

gulp.task('default', ['watch']);
@shakyShane
Copy link
Contributor

shakyShane commented Oct 9, 2018 via email

@rpkoller
Copy link
Author

rpkoller commented Oct 9, 2018

yes it contains a <body> tag.

And on a side note. I've tried the same with 2.24.5 before, but same results or better no results. Before I filed an issue 2.26.0 came out and I thought maybe that might fix things.

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

No branches or pull requests

2 participants