Задать вопрос
  • Ошибки в файле gulp?

    djkravz
    @djkravz Автор вопроса
    Больше ошибок в файле нету?(
    Ошибку выдает, что делать не знаю, хоть бери и вообще по-другому и по-новому пиши галп

    [21:22:37] Using gulpfile ~\Desktop\gulpfile.js
    [21:22:37] Starting 'default'...
    [21:22:37] Starting 'watchFiles'...
    [21:22:37] Starting 'browserSync'...
    [21:22:37] Starting 'clean'...
    [21:22:37] Finished 'clean' after 39 ms
    [21:22:37] Starting 'html'...
    [21:22:37] Starting 'css'...
    [21:22:37] Starting 'js'...
    [21:22:37] Starting 'images'...
    [21:22:37] 'js' errored after 38 ms
    [21:22:37] TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
        at Function.from (buffer.js:327:9)
        at new Buffer (buffer.js:283:17)
        at C:\Users\KRAVZ\Desktop\node_modules\gulp-rigger\index.js:20:29
        at Rigger.<anonymous> (C:\Users\KRAVZ\Desktop\node_modules\rigger\index.js:719:9)
        at Rigger.emit (events.js:310:20)
        at Rigger.EventEmitter.emit (domain.js:482:12)
        at C:\Users\KRAVZ\Desktop\node_modules\rigger\index.js:252:16
        at C:\Users\KRAVZ\Desktop\node_modules\rigger\node_modules\async\lib\async.js:232:13
        at C:\Users\KRAVZ\Desktop\node_modules\rigger\node_modules\async\lib\async.js:113:21
        at C:\Users\KRAVZ\Desktop\node_modules\rigger\node_modules\async\lib\async.js:24:16
    [21:22:37] 'default' errored after 82 ms
    [21:22:37] The following tasks did not complete: watchFiles, browserSync, html, css, images
    [21:22:37] Did you forget to signal async completion?
  • Ошибка gulp. Did you forget to signal async competition?

    djkravz
    @djkravz Автор вопроса
    Добавил к таскам дан, где его не хватало, ошибка не изменилась(
  • Ошибка gulp. Did you forget to signal async competition?

    djkravz
    @djkravz Автор вопроса
    Евгений, "use strict";

    const {src, dest} = require("gulp");
    const gulp = require("gulp");
    const autoprefixer = require("gulp-autoprefixer");
    const cssbeautify = require("gulp-cssbeautify");
    const removeComments = require('gulp-strip-css-comments');
    const rename = require("gulp-rename");
    const sass = require("gulp-sass");
    const cssnano = require("gulp-cssnano");
    const rigger = require("gulp-rigger");
    const uglify = require("gulp-uglify");
    const plumber = require("gulp-plumber");
    const imagemin = require("gulp-imagemin");
    const del = require("del");
    const panini = require("panini");
    const browsersync = require("browser-sync").create();

    /* Paths */
    var path = {
    build: {
    html: "dist/",
    js: "dist/assets/js/",
    css: "dist/assets/css/",
    images: "dist/assets/img/"
    },
    src: {
    html: "src/*.html",
    js: "src/assets/js/*.js",
    css: "src/assets/sass/style.scss",
    images: "src/assets/img/**/*.{jpg,png,svg,gif,ico}"
    },
    watch: {
    html: "src/**/*.html",
    js: "src/assets/js/**/*.js",
    css: "src/assets/sass/**/*.scss",
    images: "src/assets/img/**/*.{jpg,png,svg,gif,ico}"
    },
    clean: "./dist"
    }

    /* Tasks */
    function browserSync(done) {
    browsersync.init({
    server: {
    baseDir: "./dist/"
    },
    port: 3000
    });
    }

    function browserSyncReload(done) {
    browsersync.reload();
    }

    function html() {
    panini.refresh();
    return src(path.src.html, { base: "src/" })
    .pipe(plumber())
    .pipe(panini({
    root: 'src/',
    layouts: 'src/tpl/layouts/',
    partials: 'src/tpl/partials/',
    helpers: 'src/tpl/helpers/',
    data: 'src/tpl/data/'
    }))
    .pipe(dest(path.build.html))
    .pipe(browsersync.stream());
    }

    function css() {
    return src(path.src.css, { base: "src/assets/sass/" })
    .pipe(plumber())
    .pipe(sass())
    .pipe(autoprefixer({
    browserslist: ['last 8 versions'],
    cascade: true
    }))
    .pipe(cssbeautify())
    .pipe(dest(path.build.css))
    .pipe(cssnano({
    zindex: false,
    discardComments: {
    removeAll: true
    }
    }))
    .pipe(removeComments())
    .pipe(rename({
    suffix: ".min",
    extname: ".css"
    }))
    .pipe(dest(path.build.css))
    .pipe(browsersync.stream());
    }

    function js() {
    return src(path.src.js, {base: './src/assets/js/'})
    .pipe(plumber())
    .pipe(rigger())
    .pipe(gulp.dest(path.build.js))
    .pipe(uglify())
    .pipe(rename({
    suffix: ".min",
    extname: ".js"
    }))
    .pipe(dest(path.build.js))
    .pipe(browsersync.stream());
    }

    function images() {
    return src(path.src.images)
    .pipe(imagemin())
    .pipe(dest(path.build.images));
    }

    function clean() {
    return del(path.clean);
    }

    function watchFiles() {
    gulp.watch([path.watch.html], html);
    gulp.watch([path.watch.css], css);
    gulp.watch([path.watch.js], js);
    gulp.watch([path.watch.images], images);
    }

    const build = gulp.series(clean, gulp.parallel(html, css, js, images));
    const watch = gulp.parallel(build, watchFiles, browserSync);

    /* Exports Tasks */
    exports.html = html;
    exports.css = css;
    exports.js = js;
    exports.images = images;
    exports.clean = clean;
    exports.build = build;
    exports.watch = watch;
    exports.default = watch;