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

Update server-call.ts #2589

Merged
merged 1 commit into from Sep 29, 2023
Merged

Conversation

rsnullptr
Copy link
Contributor

I am having a TS2345 trying to bootstrap a nestjs application.

transpile/runtime time error:

╰─± npm run start 

> app@0.0.1 start
> nest start app --watch


 Info  Webpack is building your sources...

webpack 5.73.0 compiled successfully in 3246 ms
Type-checking in progress...

{"level":"LOG","message":"Starting Nest application... NestFactory","app":"JsonLogger","scope":"static-logger","timestamp":"2023-09-29T14:43:47.849Z"}

...

ERROR in ./node_modules/@grpc/grpc-js/src/server.ts:1182:7
TS2345: Argument of type 'void | Awaited<RequestType>' is not assignable to parameter of type 'RequestType'.
  'RequestType' could be instantiated with an arbitrary type which could be unrelated to 'void | Awaited<RequestType>'.
    1180 |       call,
    1181 |       metadata,
  > 1182 |       request
         |       ^^^^^^^
    1183 |     );
    1184 |
    1185 |     handler.func(

ERROR in ./node_modules/@grpc/grpc-js/src/server.ts:1249:7
TS2345: Argument of type 'void | Awaited<RequestType>' is not assignable to parameter of type 'RequestType'.
  'RequestType' could be instantiated with an arbitrary type which could be unrelated to 'void | Awaited<RequestType>'.
    1247 |       metadata,
    1248 |       handler.serialize,
  > 1249 |       request
         |       ^^^^^^^
    1250 |     );
    1251 |
    1252 |     handler.func(stream);

Found 2 errors in 9748 ms.

package.json has:

  • dependency: "@grpc/grpc-js": "^1.9.4",
  • devDependency: "@types/node": "^20.7.1"

After the fix on local

╰─± npm run start 

> app@0.0.1 start
> nest start app --watch


 Info  Webpack is building your sources...

webpack 5.73.0 compiled successfully in 3246 ms
Type-checking in progress...

{"level":"LOG","message":"Starting Nest application... NestFactory","app":"JsonLogger","scope":"static-logger","timestamp":"2023-09-29T14:43:47.849Z"}

...

No errors found.

Not sure neither why was it return void if whenever that function is called the request got be null checked. If this is completely wrong just lmk so we can figure out another solution. Thanks.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: rsnullptr / name: Rafael Santos (974b235)

@murgatroid99
Copy link
Member

This looks like a reasonable change. I'm not really sure where that void came from in the first place.

@murgatroid99 murgatroid99 merged commit 1b1903c into grpc:@grpc/grpc-js@1.9.x Sep 29, 2023
4 of 5 checks passed
@rsnullptr
Copy link
Contributor Author

@murgatroid99 can we have a new release? not sure how you manage it. Sorry if I should. Thanks

@rsnullptr rsnullptr mentioned this pull request Oct 2, 2023
@murgatroid99
Copy link
Member

This has been published in version 1.9.5.

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

Successfully merging this pull request may close these issues.

None yet

3 participants