Gulp 4 - async completion error
Closed this issue · 13 comments
I am trying to run this plugin on gulp 4 and i get:
The following tasks did not complete: styleguide. Did you forget to signal async completion?
Here is my code
const gulp = require('gulp');
const livingcss = require('gulp-livingcss');
function styleguide(){
return gulp.src('src/sass/*.scss')
.pipe(livingcss())
.pipe(gulp.dest('styleguide'));
}
gulp.task('styleguide', styleguide);
Any way to make this plugin work on gulp 4?
I'll take a look at this in gulp 4 and see what's going on, nothing's coming to mind at the moment.
So I'm not getting that error when running in gulp 4.
$ gulp -v
CLI version 1.2.1
Local version 4.0.0-alpha.2
$ gulp styleguide
Using gulpfile ~/sandbox/gulp-livingcss/gulpfile.js
Starting 'styleguide'...
Finished 'styleguide' after 73 ms
I tried it on another computer with the same gulp versions as you were using and still get the same error with async completion. It's weird.
Thank you for quick response. I will keep trying to figure this out. If livingcss is responsible for this error I will let you know.
I wonder if it has to do with the number and/or size of the files you're globbing. How many and how large are they?
I tried on 11 files. Each file have from 10 to 400 lines. Even when i cleared the directory it wouldn't run. I get the response instantaneously.
Interesting. I just tried it with 25 files totaling 300K and still completed. I wonder what's going on.
I solved it. It fails only when you don't have JSDocs comments. When I placed some example documentation to code it worked. Any way to make it not fail when there is no documentation in code? For example: generate empty styleguide.
I'll look into it.
Ok, I can reproduce that and found the problem. It's in livingcss itself, so I'll put the fix in there this week and update the pin on this repo.
Would it running and completing but not creating any output be acceptable? Maybe a helpful output saying no pages were generated?
I think it would be enough. The important part is to not break gulp task. Info would be great.
Alright, I think this pr should resolve the issue. Are you able to test it for me?
Yeah, last pull request solved the issue. Warning gives great feedback. Good and fast job!