question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SASS + CSS Injecting is not working since 2.24.0 version

See original GitHub issue

Issue details

Browsersync detects changes in css but it does not inject the new css since 2.24.0 version. You have to manually refresh the page to see the changes

Steps to reproduce/test case

Just use example on https://browsersync.io/docs/gulp to reproduce this issue.

var gulp        = require('gulp');
var browserSync = require('browser-sync').create();
var sass        = require('gulp-sass');

// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {

    browserSync.init({
        server: "./app"
    });

    gulp.watch("app/scss/*.scss", ['sass']);
    gulp.watch("app/*.html").on('change', browserSync.reload);
});

// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
    return gulp.src("app/scss/*.scss")
        .pipe(sass())
        .pipe(gulp.dest("app/css"))
        .pipe(browserSync.stream());
});

gulp.task('default', ['serve']);

Please specify which version of Browsersync, node and npm you’re running

  • Browsersync [ 2.24.2 ]
  • Node [ 10.0.0 ]
  • Npm [ 6.0.0 ]

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

for all other use-cases, (gulp, grunt etc), please show us exactly how you’re using Browsersync

gulp.task('sass', () => {
  gulp
    .src('src/scss/main.scss')
    .pipe(ifElse(isDev, () => sourcemaps.init()))
    .pipe(sass().on('error', sass.logError))
    .pipe(postcss([autoprefixer()]))
    .pipe(ifElse(isDev, () => sourcemaps.write()))
    .pipe(ifElse(!isDev, () => cleanCSS()))
    .pipe(gulp.dest('dist'))
    .pipe(browserSync.stream());
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
huilang-mecommented, May 3, 2018

We can simply use the old version to instead. npm uninstall browser-sync

npm install browser-sync@2.18.12

0reactions
shakyShanecommented, May 3, 2018

fixed in browser-sync@2.24.3

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome CSS injection suddenly not working - Stack Overflow
Show activity on this post. In the developer tools settings (click the cog at the top-right), you should see an "Auto-reload generated CSS"...
Read more >
@weareathlon/frontend-webpack-boilerplate | Yarn - Yarn
Starter project template boilerplate based on Webpack with SASS/PostCSS and babel ES6/7 support. webpack, boilerplate, template, setup. readme. Webpack 5 ...
Read more >
Ember-cli-utilities NPM | npm.io
Check Ember-cli-utilities 4.0.1 package - Last release 4.0.1 with MIT licence at our NPM packages aggregator and search engine.
Read more >
ember-cli-utilities - npm Package Health Analysis - Snyk
An important project maintenance signal to consider for ember-cli-utilities is that it hasn't seen any new versions released to npm in the past ......
Read more >
Webpack/VueJS PWA app upgrade problems (node-sass)
Hello Vue forums I have been tasked with maintaining and further development on one of our products. I am pretty new to Webpack...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found