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.

Not working with gulp-sass

See original GitHub issue

My terminal still returns an error and breaks my task when there’s an error in my Sass. This is what my task looks like:

gulp.task('sass', function() {
  return gulp.src(['./src/scss/*.scss', './src/scss/**/*.scss'])
    .pipe(plumber())
    .pipe(sass({
      includePaths : [
        './lib/basscss/scss',
        './lib/fluidbox/css'
      ],
      outputStyle: 'expanded'
    }))
    .pipe(prefix({
      browsers: ['last 2 versions'],
      cascade: false
    }))
    .pipe(minifyCSS())
    .pipe(gulp.dest('./_site/public/css'))
    .pipe(gzip())
    .pipe(gulp.dest('./_site/public/css'))
    .pipe(reload({stream: true}))
});

Any idea why it keeps breaking? Any help is appreciated. Thanks in advance!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:3
  • Comments:17 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
SandHiltcommented, May 28, 2015

@holic You’re right! @realph keep code but remove return. gulp.task(‘sass’, function() { gulp.src(…) .pipe(plumber()) .pipe(sass({…})); });

7reactions
TheAggressivecommented, Oct 3, 2015

@joshtoo I got it to work this way:

gulp.task('sass', function() {
  return gulp.src('scss/style.scss')
    .pipe(plumber())
    .pipe(sass.sync({ // Have to use sass.sync - See Issue (https://github.com/dlmanning/gulp-sass/issues/90)
      outputStyle: 'compressed',
      errLogToConsole: true
    }))
    .pipe(autoprefixer({
      browsers: ['last 2 versions', 'ie >= 9']
    }))
    .pipe(gulp.dest('./'));
});

would that do the trick?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing gulp-sass issues in gulp 4. - DEV Community ‍ ‍
Fixing gulp-sass issues in gulp 4. · You need to set your sass compiler to "sass" (Dart-sass) to completely process sass inside of...
Read more >
Gulp is not compiling SCSS to CSS - Stack Overflow
What I am doing wrong. UPDATE : Inside my Gulp file : var gulp = require('gulp'); var sass ...
Read more >
Setting up gulp 4 for automatic Sass compilation and CSS ...
Hi Joshua, your gulpfile looks fine, the issue you're describing sounds like it's either the css file not being saved in the expected...
Read more >
gulp-sass - npm
Before filing an issue, please make sure you have updated to the latest version of gulp-sass and have gone through our Common Issues...
Read more >
Compatibility with gulp-sass 4.1.1 broken with bootstrap-sass ...
1.) Gulp-sass 4.1.1 supports dart-sass. You can resolve your problem by changing the sass compiler. Remove "node-sass" from your ...
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