Sergamers
@Sergamers
front-end

Появилась ошибка в gulp?

--> Файл app\common-bundle\styles\block\_header.scss был изменен
[21:13:17] Starting 'common-bundle-build-sass'...
[21:13:17] Finished 'common-bundle-build-sass' after 22 ms
[21:13:17] 'common-bundle-watch-sass' errored after 2.93 min
[21:13:17] Error: task completion callback called too many times
    at finish (D:\hosting\radin\node_modules\orchestrator\lib\runTask.js:15:10)
    at cb (D:\hosting\radin\node_modules\orchestrator\lib\runTask.js:29:3)
    at apply (D:\hosting\radin\node_modules\thunks\thunks.js:344:38)
    at tryRun (D:\hosting\radin\node_modules\thunks\thunks.js:224:19)
    at callback (D:\hosting\radin\node_modules\thunks\thunks.js:193:24)
    at next (D:\hosting\radin\node_modules\thunks\thunks.js:314:31)
    at Gulp.successListener (D:\hosting\radin\node_modules\gulp-sequence\index.js:42:11)
    at emitOne (events.js:82:20)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (D:\hosting\radin\node_modules\orchestrator\index.js:264:8)


// Слежение за sass файлами
gulp.task('common-bundle-watch-sass', function(cb) {
  gulp.watch('app/common-bundle/**/*.scss')
    .on('add', (path) => {
      console.log('--> Файл ' + path + ' добавлен на слежение');
      gulpSequence('common-bundle-build-sass')(cb);
    })
    .on('unlink', (path) => {
      console.log('--> Файл ' + path + ' был удален');
      gulpSequence('common-bundle-rebuild-sass')(cb);
    })
    .on('change', (path) => {
      console.log('--> Файл ' + path + ' был изменен');
      gulpSequence('common-bundle-build-sass')(cb);
    })
})


Происходит при изменении файла
  • Вопрос задан
  • 686 просмотров
Решения вопроса 1
Sergamers
@Sergamers Автор вопроса
front-end
В вотч файлах не нужно делать синхронности задач. Нужно было разделить на 2 задачи
1. построение проекта
2. слежение за изменением
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы