Angush
Following documentation gives error: "You cannot dot into a client module from a server component."
I did notice while I was going through the guide that it instructs you to create this
trpc/init.ts
file to intialize the tRPC backend:
But when it's instructing you to create the trpc/server.tsx
file with this code:
It imports createCallerFactory
from that previous init file, despite never telling you to make that an export. So I took a guess and added this to the end: export const createCallerFactory = t.createCallerFactory
But I'm wondering, if the documentation had that error, does it have others? Or am I an idiot and this is this just user error, with something I'm overlooking? I'm happy to share any other files needed.6 replies
Following documentation gives error: "You cannot dot into a client module from a server component."
The
@/trpc/client.tsx
file is also basically lifted wholesale from the documentation, except for renaming the export (and one import) and enabling superjson:
Every other file involved has also not been changed much from the documentation, if at all.6 replies