gulp-bower icon indicating copy to clipboard operation
gulp-bower copied to clipboard

Plugin does not return valid async return value when called with options obj (probably)

Open isochronous opened this issue 7 years ago • 2 comments

This is using gulp-bower 0.0.13, Gulp 4, and node 6.10.0 on Windows 10.

We've got a gulpfile with two different bower tasks - one installs standard lib dependencies based on a bower.json in the root folder (alongside the gulpfile), and the other installs polymer dependencies in a folder within our /scripts directory.

The root bower task we have is just this (we have our tasks separated out as individual commonJS modules, so the format looks a little weird, but I promise they're valid tasks):

return function() {
	return plugins.bower();
};

It runs perfectly fine, and completes with no issues.

This other task, however...

return function() {
        return plugins.bower({
            cwd: './ui/src/elements/ai-common-elements'
        });
};

Gives the following error every time:

[12:54:05] Starting 'bower-elements'...
[12:54:06] Using cwd: ./ui/src/elements/ai-common-elements
[12:54:06] Using bower dir: ./bower_components
[12:54:08] The following tasks did not complete: bower-elements
[12:54:08] Did you forget to signal async completion?

After doing some google searches, I found that many others are having the same issue, but so far I haven't found a solution. The common thread among all of the reported issues is that in all cases they're being called with an options object as a parameter - either CMD or CWD. I haven't done any debugging or anything, which is why I qualified the issue title with (Probably), but it seems to be the most likely culprit based on what I've seen thus far.

isochronous avatar Jun 05 '17 17:06 isochronous

I should add that the first task (that runs against the bower.json in the root) works as expected even when called with a string param, i.e. return plugins.bower('./bower_components');. It's only when an object is passed as the param that the 'async completion' errors start showing up.

isochronous avatar Jun 05 '17 17:06 isochronous

Okay, now I've had this problem occur when calling with both no params and with just the string param. This is starting to be a major issue, as none of our bower-related tasks work properly, and thus our build never completes.

isochronous avatar Jun 15 '17 19:06 isochronous