Questions tagged [gulp-4]

use this tag for specific issues about Gulp version 4 or upgrading to version 4; use the [gulp] tag for general gulp issues

Gulp version 4

gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow.

Github project: https://github.com/gulpjs/gulp/tree/4.0

Upgrade instructions: https://codeburst.io/switching-to-gulp-4-0-271ae63530c0

Guide to Upgrading to Gulp 4: https://www.joezimjs.com/javascript/complete-guide-upgrading-gulp-4/

115 questions
12
votes
3 answers

Run Gulp 4 task programmatically

There are several tasks defined with gulp.task in gulpfile.js: gulp.task('sync-task', () => { ... }); gulp.task('async-task', cb => { ... }); I would like to start one of them programmatically. Preferably in the same process (no exec, etc.),…
Estus Flask
  • 206,104
  • 70
  • 425
  • 565
11
votes
2 answers

What about this combination of gulp-concat and lazypipe is causing an error using gulp 4?

I'm upgrading from Gulp 3 to 4, and I'm running into an error: The following tasks did not complete: build Did you forget to signal async completion? I understand what it's saying, but can't understand why this code is triggering it. Error or not,…
goodforenergy
  • 520
  • 1
  • 4
  • 18
7
votes
1 answer

Gulp 4 - splitting up main gulpfile.js

I am trying to use Gulp4 API and writing a very basic and simple tasks to start with and am having some issues with splitting up the gulp file. Basically I have two standalone tasks, one for minifying CSS and another for minifying JS which I am…
user1809790
  • 1,349
  • 5
  • 24
  • 53
7
votes
2 answers

gulp.series() doesn't run tasks

I can't figure out why gulp.series() is not firing in my callback function. I'm trying to grab a string from a user input with gulp-prompt and invoke a build and deployment function with gulp.series(). My tasks within gulp.series() don't fire at…
jmdesigner81
  • 153
  • 3
  • 12
6
votes
3 answers

Gulp 4 Split Tasks Across Multiple Files Using Gulp-Hub Fails Due to Missing Get Function

Using Gulp 4 and the recipe for splitting my tasks into multiple files using gulp-hub throws this error just from attempting to load the task files. The task file is super simple just wanted to test everything was working. I found this reference on…
mtpultz
  • 17,267
  • 22
  • 122
  • 201
5
votes
1 answer

gulp 4 version problem causes all tasks to fail

gulp decided it had enough and it died in my project. current version gulp -v [11:26:35] CLI version 3.9.1 [11:26:35] Local version 4.0.0 if i run one of the tasks that worked yesterday I get the following error: C:\Program…
J King
  • 4,108
  • 10
  • 53
  • 103
5
votes
2 answers

How can I check to see if a task is ran as a dependency of another task in gulp@4?

I use gulp-notify to trigger notifications when tasks complete. If a task is ran standalone, a notification for that specific task is triggered. If a task is ran as a dependency of another task, a notification for all dependencies is triggered. In…
JacobTheDev
  • 17,318
  • 25
  • 95
  • 158
5
votes
1 answer

Gulp 4: how to detect the "Did you forget to signal async completion?" error in a complex build script

As people who have migrated to Gulp 4 may know, gulp.series – as it should – won't proceed with execution if a task in the series doesn't signal completion properly. My problem with that is the way it handles this kind of error – it's simply a…
Dániel Kis-Nagy
  • 2,255
  • 2
  • 18
  • 19
4
votes
0 answers

Detect changes between multiple source files using Gulp

The original issue I was having was that the task was running x amount of times for the number of files existing inside src.pages, I fixed this by adding the 'changed-in-place' plugin, to compare the last date modified of the source files. This…
Luke
  • 195
  • 2
  • 16
4
votes
1 answer

Gulp watch not emitting event object

Gulp (4.0) throws the error "Error: Invalid glob argument: undefined" when I attempt to gulp.src the path of a changed file obtained from gulp.watch. Both this: gulp.task('watch', function() { gulp.watch('./web/**/*.html') .on('change',…
dansalias
  • 737
  • 6
  • 11
4
votes
1 answer

Gulp 4 - Error: write after end

I'm getting an error when I watch for changes in index.html (full path in CONFIG.APP.INDEX). All my tasks are in separate files. this is tasks/watch.ts, for example: import * as CONFIG from '../config'; export default done => { // other watches …
Sasxa
  • 40,334
  • 16
  • 88
  • 102
3
votes
1 answer

Gulp 4 watch() TypeError: expected a string

I have encountered a problem while starting gulp. The info I got is from https://coder-coder.com/gulp-4-walk-through/ and https://www.youtube.com/watch?v=-lG0kDeuSJk. my gulpfile.js // Initialize modules const { src, dest, watch, series, parallel }…
Branko Anokic
  • 35
  • 2
  • 6
3
votes
1 answer

Gulp 4 - AssertionError [ERR_ASSERTION]: Task never defined: undefined

Trying to run my default task I keep getting the following error message: [10:52:59] Starting 'watchFiles'... [10:52:59] 'watchFiles' errored after 1.11 ms [10:52:59] AssertionError [ERR_ASSERTION]: Task never defined: undefined at getFunction…
LindaBytes
  • 41
  • 1
  • 5
3
votes
1 answer

How to get Gulp watch working after migration from v3 to v4?

I have an app with a very moderate gulpfile. I've just upgraded Gulp from v3.9.1 to v4.0.2 and adapted the gulpfile.js. All tasks are working fine again, only the watching is not. There are no errors, but Gulp watch seems not to be checking the…
automatix
  • 14,018
  • 26
  • 105
  • 230
3
votes
1 answer

Gulp 4 watch task is not detecting changes

I am trying to switch to Gulp version 4 from Gulp version 3 and I am constantly having issues with watch task, it will not detect changes when the tracked SCSS file is changed. I made a simple example of the watch function since it is easier for…
srdjan
  • 33
  • 1
  • 5
1
2 3 4 5 6 7 8