yash icon indicating copy to clipboard operation
yash copied to clipboard

Cannot compile the extension

Open rhanqtl opened this issue 3 years ago • 1 comments

I'm trying to solve #26, but have trouble compiling the extension.

When I run npm run compile, tsc throws following errors:

> [email protected] compile
> tsc -p ./

src/runner.ts:26:25 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'T | PromiseLike<T>'.

26                 resolve(cancelValue());
                           ~~~~~~~~~~~~~

src/runner.ts:30:29 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'T | PromiseLike<T>'.

30                     resolve(cancelValue());
                               ~~~~~~~~~~~~~

src/runner.ts:47:25 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'T | PromiseLike<T>'.

47                 resolve(cancelValue());
                           ~~~~~~~~~~~~~

src/runner.ts:52:33 - error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'T | PromiseLike<T>'.

52                         resolve(cancelValue());
                                   ~~~~~~~~~~~~~


Found 4 errors in the same file, starting at: src/runner.ts:26

Any ideas?

Environments:

$ node -v
v19.6.0
$ npm -v
8.19.2
$ npm list typescript   
[email protected] ~/projects/yash
└── [email protected]

rhanqtl avatar Feb 17 '23 09:02 rhanqtl

Hey, one hack is to cast undefined in cancelValue:

function cancelValue<E>() {
    console.log("Request cancelled...");
    return undefined as unknown as E;
}

hardik-rajpal avatar Mar 06 '23 05:03 hardik-rajpal