segment_treeS
tRPC16mo ago
4 replies
segment_tree

all my inferred typings on the frontend are `any`

I have a backend trpc router like this:

import likeRouter from './like';
import postRouter from './post';
import {router} from '../index';
const appRouter = router({like: likeRouter, post: postRouter});
export { appRouter };
export type AppRouter = typeof appRouter;


I import the type into my React Native client.

import type { inferRouterInputs, inferRouterOutputs } from "@trpc/server";
import type { AppRouter } from "../../../backend/src/trpc/routers/app";


But when I try to use inferences, it gets typed weirdly:

type RouterOutputs = inferRouterOutputs<AppRouter>;


Gets typed as:
port type { inferRouterInputs, inferRouterOutputs } 
 
@trpc
type RouterOutputs = {
    like: any;
    post: any;
}


Why is this happening? My versions across client and server are synced, and I have strict mode on.
Was this page helpful?