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

When output parser is used in the procedure, ctx.data argument type is unknown (invalid type) #22

Closed
swallowtail62 opened this issue Jul 10, 2023 · 1 comment · Fixed by #21

Comments

@swallowtail62
Copy link
Contributor

swallowtail62 commented Jul 10, 2023

Describe the bug
As the title suggests, the argument type of the ctx.data function is not correctly inferred.

image

image

To Reproduce
Steps to reproduce the behavior:

  1. Create a router with a procedure with output parser.
  2. Create the mock service worker, as above, with your AppRouter inferred type.
  3. Check the type of ctx.data function.

Expected behavior
The expected behavior is the argument type of ctx.data is inferred as the return type of the output parser.

Versions
typescript: v5.1.6
tRPC: v10.33.1
msw: v1.2.2

@swallowtail62
Copy link
Contributor Author

Hey @maloguertin, thanks for the review.
I see that you have released a new version, but the dist doesn't seem to have been updated. I could be mistaken, but could you check?

image
image

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 a pull request may close this issue.

1 participant