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

Issue with typescript 4.1 #1804

Closed
flovilmart opened this issue Jun 2, 2021 · 1 comment
Closed

Issue with typescript 4.1 #1804

flovilmart opened this issue Jun 2, 2021 · 1 comment

Comments

@flovilmart
Copy link

Problem description

Since typescript 4.1, the promise resolution typing has changed.
This change is documented here and well known.

Reproduction steps

Opened the following branch to demonstrate the issue.

Running npm install or npm run compile

> @grpc/[email protected] compile /Users/florentvilmart/src/grpc/grpc-node/packages/grpc-js
> tsc -p .

src/call-credentials.ts:118:23 - error TS2345: Argument of type '{ [index: string]: string; } | undefined' is not assignable to parameter of type '{ [index: string]: string; } | PromiseLike<{ [index: string]: string; }>'.
  Type 'undefined' is not assignable to type '{ [index: string]: string; } | PromiseLike<{ [index: string]: string; }>'.

118               resolve(headers);
                          ~~~~~~~

src/server-call.ts:511:13 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?

511             resolve();
                ~~~~~~~~~

  node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
    33     new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'value' was not provided.

src/server-call.ts:518:11 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?

518           resolve();
              ~~~~~~~~~

  node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
    33     new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'value' was not provided.

Environment

@flovilmart
Copy link
Author

Closing as not applicable and #1807 is exposing the proper interface now

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

1 participant