trpc server actions: experimental_nextAppDirCaller

So, I saw this in one of the recent videos that you t3 rockstars are doing gods work and adding server actions to trpc: https://trpc.io/blog/trpc-actions So, I am trying to implement this, but am constantly running into issues. Would be LOVELY to get a video from Theo explaining the best way to use t3-stack with server actions and shadcn forms. Like the happy path. Maybe its just not finished baking, so i m premature in my question here. But if anybody got trpc working with server actions let me know.
Using Server Actions with tRPC | tRPC
The builder-pattern for creating procedures which was introduced in tRPC v10 has been massively appreciated by the community, and many libraries have adopted similar patterns.
2 Replies
AlexAnarcho
AlexAnarcho6d ago
Here is a little more information: The full error is:
trpc.ts 112 35 error 2345 Argument of type '{ pathExtractor: ({ meta }: { meta: unknown; }) => string; }' is not assignable to parameter of type '{ pathExtractor?: ((opts: { meta: unknown; }) => string) | undefined; normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; user: User | null; }>) => void) | undefined...'.
Property 'createContext' is missing in type '{ pathExtractor: ({ meta }: { meta: unknown; }) => string; }' but required in type '{ pathExtractor?: ((opts: { meta: unknown; }) => string) | undefined; normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; user: User | null; }>) => void) | undefined...'. (lsp)
trpc.ts 112 35 error 2345 Argument of type '{ pathExtractor: ({ meta }: { meta: unknown; }) => string; }' is not assignable to parameter of type '{ pathExtractor?: ((opts: { meta: unknown; }) => string) | undefined; normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; user: User | null; }>) => void) | undefined...'.
Property 'createContext' is missing in type '{ pathExtractor: ({ meta }: { meta: unknown; }) => string; }' but required in type '{ pathExtractor?: ((opts: { meta: unknown; }) => string) | undefined; normalizeFormData?: boolean | undefined; onError?: ((opts: ErrorHandlerOptions<{ headers: Headers; db: PrismaClient<{ log: ("query" | "warn" | "error")[]; }, never, DefaultArgs>; session: Session | null; user: User | null; }>) => void) | undefined...'. (lsp)
No description
AlexAnarcho
AlexAnarcho6d ago
I am not even sure if I put the code at the right location. But I think yes, since the other trpc configuration is also done in src/server/api/trpc.ts