tmp.st
TTCTheo's Typesafe Cult
•Created by tmp.st on 11/24/2024 in #questions
createCaller(...) & createHydrationHelpers<...>(...) clash. What is going on?
For edge cases like mine, I think it would be good to have some sort of fallback mechanism that dynamically ensures the router has at least one default route if none are provided, i'll try to submit a pull request later for this
6 replies
TTCTheo's Typesafe Cult
•Created by tmp.st on 11/24/2024 in #questions
createCaller(...) & createHydrationHelpers<...>(...) clash. What is going on?
Otherwise, the inferred type defaults to an empty object and causes type errors
6 replies
TTCTheo's Typesafe Cult
•Created by tmp.st on 11/24/2024 in #questions
createCaller(...) & createHydrationHelpers<...>(...) clash. What is going on?
Specifically, AppRouter is ensuring that
createHydrationHelpers
and whatever else had the correct type context for the router. If no tRPC routes are defined, createHydrationHelpers
will fail because it relies on a valid AppRouter that represends atleast one populated tRPC router in the application6 replies
TTCTheo's Typesafe Cult
•Created by tmp.st on 11/24/2024 in #questions
createCaller(...) & createHydrationHelpers<...>(...) clash. What is going on?
6 replies
TTCTheo's Typesafe Cult
•Created by tmp.st on 11/24/2024 in #questions
createCaller(...) & createHydrationHelpers<...>(...) clash. What is going on?
Solved. For others who are experiencing the same issue, this happens if you do not provide any TRPC routers in
server/api/root.ts
appRouter.6 replies