shbangng
TTCTheo's Typesafe Cult
•Created by shbangng on 12/27/2023 in #questions
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 question3 replies