Kranga
Kranga2y ago

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
julius
julius2y ago
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?
Kranga
Kranga2y ago
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
julius
julius2y ago
You got a repro?
Kranga
Kranga2y ago
Gonna make one quick
Kranga
Kranga2y ago
GitHub
GitHub - kran6a/trpc-inference-repro
Contribute to kran6a/trpc-inference-repro development by creating an account on GitHub.
julius
julius2y ago
strictNullChecks: false seems to be the culprit
julius
julius2y ago
Kranga
Kranga2y ago
Yep, it fixed it Thanks for your help, the error was driving me mad