scrubdaddy
scrubdaddy
TtRPC
Created by scrubdaddy on 7/20/2024 in #❓-help
Compiling Frontend
In my frontend, I try to import the backend types: - import type { AppRouter } from "../../../lambda/api-handler/src"; however, now my frontend cannot build as it has a different typescript configuration than my backend. What is the intended solution here? Is it possible to import these types without using a single tsconfig/build step across backend and frontend?
4 replies
TtRPC
Created by scrubdaddy on 7/17/2024 in #❓-help
Types not being shared with the frontend
Hello, I am currently trying to follow a guide to setup a new project and encountering this error in the client:
Property 'greet' does not exist on type 'TRPCClient<CreateRouterInner<RootConfig<{ ctx: { event: APIGatewayProxyEvent; apiVersion: string; user: string | undefined; }; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>>'.ts(2339)
Property 'greet' does not exist on type 'TRPCClient<CreateRouterInner<RootConfig<{ ctx: { event: APIGatewayProxyEvent; apiVersion: string; user: string | undefined; }; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>>'.ts(2339)
both projects have ts strict mode enabled. the same versions of trpc, and i installed the server package on the client
8 replies