-
Notifications
You must be signed in to change notification settings - Fork 21
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
ctx is untyped.. #2
Comments
Hi kristian, I'll try to get around to debugging your use case today! |
That's awesome, thank you. I am happy to help as well, I just wanted to make sure I wasn't missing something simple first. |
Could you give me a reproducible example of a trpc router |
With this AppRouter definition: const appRouter = router({
user: publicProcedure
.input(Number)
.output(Object)
.query((req) => ALL_USERS.find((user) => req.input === user.id)),
}); I get the same result. Let me know if I should try and set up a repository for you. |
Here's my setup:
If you can give me a repo it would help :) |
Interesting. Well it's good to know that it should work -- in that case I will first try and check that I didn't do something stupid. I'll report back here, either with the fix or with a reproduction repo :-) |
I am having the same problem here |
Hi! Could you fill this template to help me narrow down the bug: Describe the bug To Reproduce
Expected behavior Versions |
what would be the type of ctx in this example ? |
I tried copy and paste your example and it doesn't work, can you tell me the version of msw you are using ? |
wait reinstalling msw seems to solve the issue, not sure why |
@CUexter sadly that doesn't seem to solve it for me. Which version of TS are you using? |
@kristiandupont 4.9.4, try installing the old version of msw from 0.49.3 ? |
That worked, thank you!! |
i tried updating it back and it still works. This is weird, what package manager are u using, I am using |
Weird indeed. I haven't tried updating after this, but I think I will leave it for now. I am using Yarn. |
So it seems like the issue might be with latest version of MSW? |
Well I tried first upgrading to the latest version which didn't do anything. I then downgraded to exactly version 0.49.3 as per CUexter's suggestion, and then it worked. |
But I upgrade it back up and it does seem to work as well idk
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Kristian Dupont ***@***.***>
Sent: Wednesday, February 15, 2023 9:37:42 PM
To: maloguertin/msw-trpc ***@***.***>
Cc: CHAN, Lik Yan Nathan ***@***.***>; Mention ***@***.***>
Subject: Re: [maloguertin/msw-trpc] ctx is untyped.. (Issue #2)
Well I tried first upgrading to the latest version which didn't do anything. I then downgraded to exactly version 0.49.3 as per CUexter's suggestion, and then it worked.
—
Reply to this email directly, view it on GitHub<#2 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AS6TD5F4ADEHUXSE5USB5BDWXTL2NANCNFSM6AAAAAAUQMK7UU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@maloguertin I am sorry, it doesn't work for 1.0.1. I was wrong. |
Sorry I've been pretty busy. It's weird, I am using MSW 1.0.1 and ts 4.9.5 (tried with 5 too) and it works. |
If you can give me a repo with the issue I'll try fixing it. |
should be fixed with https://github.com/maloguertin/msw-trpc/releases/tag/v1.3.0 |
Your library is exactly what I was hoping to find, thank you!
The one issue I have right now is that the
ctx
parameter is untyped. This is surprising to me as it appears that it should be correctly typed via theExtractProcedureHandler
type.My
mswTrpc
instance is pretty straight forward:..what am I missing?
The text was updated successfully, but these errors were encountered: