The async task in Gulp version 4 seems to be hanging and not completing its

Currently, I'm in the process of transitioning my tasks to functions while working with v4 gulp. One of the tasks involves implementing a simple clean function that executes a parallel task.

const clean_server = () => del('build/server/*');
const clean_client = () => del('build/client/*');

export function clean(done) {
  gulp.parallel(clean_server, clean_client);
  done();
}

After following the suggested method from the official documentation, where I call done() as shown above, although the task starts running, it fails to complete properly.

However, things take a different turn when I make a slight adjustment:

export function clean(done) {
  gulp.parallel(clean_server, clean_client)(done);
}

This modification actually works.

With that said, my inquiry revolves around why the initial approach recommended by the documentation doesn't successfully finish the asynchronous task?

Answer №1

The requirement is for done to be supplied as a callback function to parallel. This can be achieved in the same manner as you have done or alternatively, following the example below:

gulp.parallel(done => {
  clean_server()
  clean_client();
  done();
})

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Include a CSS file from an external JavaScript file

Is there a way to include an external CSS file in an external JS file? I am trying to reference and load Default.css inside Common.js like the image below shows. Any suggestions are greatly appreciated! BB ...

The Array.sort method is limited to sorting based on a single criterion

I'm attempting to sort items first by their values and then alphabetically if they have the same value. function order(a, b, total) { if (total == 0) { return a.localeCompare(b) } else { return total; } } var thingsArr = { ...

Encountering a 500 internal server error when utilizing jQuery and Ajax with Laravel 5.2

I have been working on a post editing system using jQuery and Ajax in Laravel 5.2. But when I try to save the changes by clicking on the button inside my Bootstrap modal, an error pops up: Error: POST http://localhost:8000/edit 500 (Internal Server Error) ...

The callback function in the SetState method's second parameter seems to be malfunctioning

I'm struggling with not being able to access the second parameter of the setState react function. While I understand that it is an asynchronous function with its own set of rules, something seems off and I can't seem to progress past this point. ...

Step-by-step guide for setting up chartjs on Laravel 6 using npm

Can anyone guide me on how to properly install and integrate [email protected] in my laravel application? Currently, I am using cdn links, but I want to avoid that in the future. List of cdn links being used: <script src="https://cdnjs.c ...

Selenium Refuses to Launch My Local Browser Despite Explicit Instructions

While using Chrome browser with selenium, I encountered an issue related to browser profiles. Everything works smoothly when the correct binary path is provided, but if an incorrect path is given, it refuses to run. The specific problem arises when the br ...

What is preventing us from assigning the jquery selector object to a different object's property for later use?

I'm facing an issue in the code below where I am trying to assign a jQuery selector object to another object property but it's not functioning as expected. Can you help me identify what mistake I might be making? index.html <html lang="en"&g ...

Guidelines for removing a 2D Primitive in processing

I am facing issues with deleting 2D primitives. I attempted to create a rectangle in front of these primitives to conceal them. However, I need to hide them when clicking somewhere, which leads me to believe that the draw() function is overriding the mouse ...

Deploying and operating passport express node on azure: A comprehensive guide

I am currently developing an express node service for Single Sign-On (SSO) using the passport OAuth2 strategy. Here is the structure of my express node application code: AUTH - certs server.cert server.key -index.html -index.js (creates app as expr ...

Error encountered: Unable to access undefined properties while attempting to make an API call to AirTable using NextJS version 13.4

Currently in the process of learning how to use the App router with NextJS 13.4, I encountered an issue while attempting to make an external API call. Even though I am getting all the data correctly from Airtable, Next throws an error that disrupts my try ...

Struggling to incorporate pagination with axios in my code

As a newcomer to the world of REACT, I am currently delving into the realm of implementing pagination in my React project using axios. The API that I am utilizing (swapi.dev) boasts a total of 87 characters. Upon submitting a GET request with , only 10 cha ...

Transforming card dimensions with Bootstrap

I am currently working on my web portfolio and I am looking to create a card format that includes an image thumbnail with text below it. However, I am facing an issue where I cannot control the size of the initial image, resulting in misaligned cards. htt ...

Is there a way to pause the scrolling on the ScrollPath jQuery plugin when it reaches a specific element?

Is it possible to pause the jQuery ScrollPath plugin at each DIV for a brief period of time? I have observed similar functionality in other plugins and find it quite useful. I have come across this feature on various websites, where the scrolling stops mo ...

Cannot find JS variable after loop has completed

I am struggling to understand why the value of my variable is not changing in my function. Here is my code snippet: var count = function(datain){ let temparr = [], countobj = {}; $.each(datain, function(key, val) { console.log(temparr); cou ...

What are the pros and cons of passing an imported object from a parent component to its children as props versus directly importing that object within the children components?

My current project involves a helper object known as TimeHelper, which is used for time-related tasks. This object is required in multiple components within the top-level parent component. I am contemplating whether it would be advantageous to import Time ...

"When testing with an API client, NextJS 13 successfully returns a response, however, the same response

Having trouble getting a clear answer on something really simple. I've created an API route: // /api/test/route.js export async function GET(request, response) { console.log("requested"); return NextResponse.json({ my: "data" ...

What is the best way to retrieve past data using RTK Query?

When working with data retrieval using a hook, my approach is as follows: const { data, isLoading } = useGetSomeDataQuery() The retrieved data is an array of items that each have their own unique id. To ensure the most up-to-date information, I implement ...

Adjust mouse coordinates to be relative to the coordinates of the <canvas> element

I'm currently facing the challenge of determining the exact location of the mouse on a canvas grid while still maintaining resizability. As of now, I have the mouse coordinates based on its position on the screen (x and y). The issue arises from the ...

manipulate the form information in node.js

My form.html is very simple: <form id="login-form" action=" ?? " method="post">Email <br/> <input type="text" name="Email" id="em" /> <br/>password <br/> <input type="text" name="password" id="pas" /> ...

Flask not serving Favicon and images to a React application

I am currently working with a Flask server and have it set up in the following manner: app = Flask(__name__, static_folder="dist/assets", static_url_path='/assets', template_folder="dist") ...