Types issues upgrading to v11, `never` when using t.router
Hi, we have a mono repo project that we are trying to upgrade from v10.45.2 to v11(next). However, we are running into a weird types issue. This codebase was/is working completely fine with v10.45.2 but upgrading package versions seems to be causing types issues. Maybe we have missed something.
We have a base trpc defined in a shared package
trpc-shared
.
Now, over in our api
project, we consume the router to create some endpoints.
However, the type of AppRouterInputs
is
The types were working fine with v10.45.2 and the only change is the package updates, no other code changes (and based on the migration guide and our current existing code base, no breaking changes were affecting our codebase). Clearing node_modules and reinstalling/rebuilding does not help.
1 Reply
Weird thing is, if I use
initTrpc
directly in the api
project in the exact same way as in the shared project, the types start working.
Now AppRouterInputs
has correct typing instead of never
We are using typescript 5.6.2, node v22.9.0, pnpm v9.12.0 and have sctrict: true
, also have