tRPCttRPC
Powered by
SchnozzleCatS
tRPC•9mo ago•
4 replies
SchnozzleCat

Type inference issues after upgrading to Typescript 5+

After upgrading an API consuming project from typescript 4 to 5, my calls to
.query
.query
are inferred to
any
any
instead of the actual type. I've tried a bunch of different things but can't seem to get it to work. I also couldn't find anything specifically related to this wrt. TS5.

I'm assuming the issue is that some compiler settings changed, and this is somehow breaking the import.
What's strange is that the
AppRouter
AppRouter
imported from the referenced project seems to have the correct shape, but somehow calling a
query
query
on the router instance still fails.
image.png
image.png
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

TSC errors after upgrading to v11
EvanEEvan / ❓-help
2y ago
Complex type inference on router outputs?
ianIian / ❓-help
2y ago
Incorrect type inference with discriminated unions.
dechoDdecho / ❓-help
3y ago
Losing type inference in vs-code
La grande murailleLLa grande muraille / ❓-help
3y ago