Trouble inferring the type of a very simple structure of nested routers
A very simple router results in an inference error, causing the client to not be able to infer the router type.
I am using the proxy-beta.24 version along with typescript 4.9.1
export const app_router = t.router({
metadata: t.router({
versions: t.procedure.query(() => ({engine: '0.0.1'}))
})
});
8 Replies
1. Are all your tRPC versions on beta.24? I’ve seen the rootconfig error before when someone had missmatching versions of tRPC server/client/…
2. Can you test with a stable version of typescript?
1. Just checked the package.json of trpc client and server and both are on beta.24.
2. I downgraded typescript to 4.8.4 and the error still persists
You got a repro?
Gonna make one quick
GitHub
GitHub - kran6a/trpc-inference-repro
Contribute to kran6a/trpc-inference-repro development by creating an account on GitHub.
strictNullChecks: false
seems to be the culpritYep, it fixed it
Thanks for your help, the error was driving me mad