Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile the extension #30

Open
rhanqtl opened this issue Feb 17, 2023 · 1 comment
Open

Cannot compile the extension #30

rhanqtl opened this issue Feb 17, 2023 · 1 comment

Comments

@rhanqtl
Copy link

rhanqtl commented Feb 17, 2023

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]
@hardik-rajpal
Copy link

Hey, one hack is to cast undefined in cancelValue:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants