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