Comments (2)
If you emit an error
event in the handler, this will cause an infinite loop. Actually throwing the PluginError
works perfectly:
gulpSass.logError = function logError(error) {
throw new PluginError('sass', error.messageFormatted);
};
from gulp-sass.
To @agarzola and @cdfa: THANK YOU!
I've been troubleshooting my gulp workflow all day, finally deciding to try to fix an issue that has been plaguing us for over a year! The watch task just hangs whenever there is a sass compilation error, and must be restarted. I've tried everything else, but throwing an error or this.emit('error')
both fix the issue.
EDIT: It does seem like in one of my attempts, this.emit('error')
did in fact result in an infinite loop of "undefined" logged to my console.
EDIT2: While throwing an error allows my watch task to continue working, plumber
no longer picks up the error. I do some logging/notifications for gulp errors, so this isn't ideal.
EDIT3: Passing the done
argument to the error handler seems to allow the error to get picked up by plumber
while also ending the task and allowing watch
to continue, but it also outputs to the console, so there's a bit of noise but it's better than it was before.
export function styles( done ) {
return gulp.src( src )
.pipe( plumber( errorHandler ) )
.pipe( sass.sync().on( 'error', done ) )
.pipe( gulp.dest( dest );
}
from gulp-sass.
Related Issues (20)
- Could you help update node-sass? HOT 2
- Replace deprecated node-sass with officially supported dart-sass HOT 1
- Dart SASS Options not Working HOT 7
- nevermind
- The following tasks did not complete: sass - Did you forget to signal async completion? HOT 1
- Migrate to the new dart-sass JavaScript API HOT 4
- Quiet option HOT 2
- Can't find stylesheet to import in monorepo HOT 1
- How to include separate css without file concatenation? HOT 2
- Please upgrade ansi-regex to 6.0.1
- 'importers' settings not working to work with '~' replacement, have to choose @mr-hope/gulp-sass
- Why can't I use @use with this? HOT 2
- Inline comments removed after compilation
- Unable to install with ancient version of node.
- support @use
- Wrong autocomplete for outputStyle in vscode
- `render()` and `renderSync()` are deprecated for the `sass` package
- Passing includePath as an array
- Incompatibility with Node 22.0.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-sass.