gulpclass icon indicating copy to clipboard operation
gulpclass copied to clipboard

Unable to find tasks with gulpclass version 0.2.0

Open MLivotto opened this issue 6 years ago • 1 comments

Issue

After installing the newest version of gulpclass ([email protected]) in my project and copy-pasting an example sketch to test it out, nothing worked as it was supposed to. Knowing that the setup I had and the code I used should in theory work, led us to debug everything that could be a reason for failure.

Comparing my project and project settings to that of one of my colleagues (where gulpclass worked just fine) made clear that there has to be an issue with the newest version (v0.2.0), since he has gulpclass v0.1.2 installed.

"Solving" the issue

For troubleshooting purposes I used the following testing-code in my gulpfile.ts (for both gulpclass-verions 0.1.2 and 0.2.0).

import { Gulpclass, Task } from "gulpclass";

@Gulpclass()
export class Gulpfile {

    @Task("default")
    defaultTask(done: () => void) {
        console.log("Testing gulpclass version..");

        done();
    }

}

Running this with [email protected] gave me following result in the visual studio code terminal:

...
[12:44:10] Task 'default' is not in your gulpfile
[12:44:10] Please check the documentation for proper gulpfile formatting

In contrast, [email protected] printed the output you would expect:

...
[12:48:14] Starting 'default'...
Testing gulpclass version..
[12:48:14] Finished 'default' after 377 μs

The example project can be downloaded here.

Changing version

I simply changed the version number in the projects package.json-file and ran npm i in the vsc-terminal.

MLivotto avatar Sep 03 '18 11:09 MLivotto

Same issue. Resolved by:

npm uninstall gulpclass
npm install [email protected]

clearw5 avatar Oct 04 '18 08:10 clearw5