R
R
Ruslan Dasaev2019-04-22 15:35:50
npm
Ruslan Dasaev, 2019-04-22 15:35:50

Why is there an error in gulp 4 The following tasks did not complete?

Hello.
Where can there be an error
? In the console it gives:

[15:20:13] The following tasks did not complete: build, removedist
[15:20:13] Did you forget to signal async completion?

gulp.task('removedist', function() { return del.sync('dist'); });
gulp.task('build', gulp.parallel( 'removedist', 'imagemin', 'styles', 'scripts'), function() {

    var buildFiles = gulp.src([
        'app/*.html',
        'app/*.php',
        'app/.htaccess',
        ]).pipe(gulp.dest('dist'));

    var buildCss = gulp.src([
        'app/css/main.min.css',
        ]).pipe(gulp.dest('dist/css'));

    var buildJs = gulp.src([
        'app/js/scripts.min.js',
        ]).pipe(gulp.dest('dist/js'));

    var buildFonts = gulp.src([
        'app/fonts/**/*',
        ]).pipe(gulp.dest('dist/fonts'));

});

Or throw off a normally working task for building a project for production in gulp 4, I'll try to fasten it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Dobrin, 2019-04-24
@andreydobrin

gulp.task('removedist', function (done) {
    del.sync('dist');
    done();
});

You need to know that the function has ended. If it doesn't help, then write what happened after my code.
If you got version 4 gulp, then for your assembly it should look like this: task
gulp.task('build', 
  gulp.series(
    'removedist',
    gulp.parallel(
      'imagemin', 
        'styles', 
        'scripts'
)));

Note if it helped. If you have any questions, please unsubscribe. If there is a problem, then so be it. You should copy this code and maybe modify it for your assembly.

G
Graff_us, 2021-06-07
@Graff_us

can someone help me too, the same error but related to connecting fonts through a mixin.
I want to make sure that when updating the gallp, there is a check that if something is written in the _fonts.scss file, then do not rewrite it, but leave it as it is.
and then always when I restart the galp, the include line is updated and erases what I changed in the include.

const cb = () => { };
let srcFonts = './src/scss/basic/_fonts.scss';
let appFonts = './app/fonts/';
const fontsStyle = (done) => {
   let file_content = fs.readFileSync(srcFonts);
   fs.writeFile(srcFonts, '', cb);
   fs.readdir(appFonts, function (err, items) {
      if (items) {
         let c_fontname;
         for (var i = 0; i < items.length; i++) {
            let fontname = items[i].split('.');
            fontname = fontname[0];
            if (c_fontname != fontname) {
               fs.appendFile(srcFonts, '@include font("' + fontname + '", "' + fontname + '", 400, "normal");\r\n', cb);
            }
            c_fontname = fontname;
         }
      }
   });
   done();

};

   watch('./src/fonts/**.ttf', fonts);
   watch('./src/fonts/**.ttf', fontsStyle);

exports.fontsStyle = fontsStyle;

exports.default = series(clean, parallel(htmlInclude, scripts, fonts, resources, imgToApp), fontsStyle, styles, watchFiles);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question