Struggle in tRPC with "use server" not working
Using the create-t3-app latest, I am trying to replace this
CreatePost
that exist in import { CreatePost } from "@/app/_components/create-post";
to use the import "server-only";
way.
The simple change I added, per Theo's example: https://github.com/t3dotgg/server-actions-trpc-examples/blob/main/src/app/rsc-trpc-action/page.tsx , I replaced the CreatePost
with
However, when i try to build this with pnpm build, i get this error:
Does this implies that somehow the code under "src/trpc/server.ts" is not working correclty? I notice that the implementation for api,
is different from that given in Theo's example code:
? Thank you for reading a noob questionGitHub
server-actions-trpc-examples/src/app/rsc-trpc-action/page.tsx at ma...
Contribute to t3dotgg/server-actions-trpc-examples development by creating an account on GitHub.
1 Reply
Instead of
Try:
The latest t3-app, uses
createTRPCProxyClient
as you pointed and it behave like a query client