-
Hi, Trying to implement tRPC on my existing Next.js 13 project and can't figure out why I'm getting this error. Followed the nextjs guide from the docs and also used create-t3-turbo implementation. Also tried to google the error. But no luck. Then I tried with a brand new Nextjs 13 project as I was thinking something with my existing project might be wrong and same result. So I must be missing something on the implementation. Here is the reproduction repo: trpc-test
This repo has no src folder structure. Tried another version with src folder but got the same result. Would appreciate guidance on how to solve this. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The issue was with the transformer variable with superjson being exported use to init tRPC. Importing and using directly superjson solved the issue. |
Beta Was this translation helpful? Give feedback.
-
Environment: Astro with React Islands, trpc and drizzle-orm Issue Encountered: After following the setup guide and implementing tRPC in my project, I encountered the following error:
Original implementation: import { createTRPCReact } from "@trpc/react-query";
import { type RootRouter } from "@lib/trpc/router"; // This import was causing the issue
export const trpcReact = createTRPCReact<RootRouter>(); Solution: import type { RootRouter } from "@lib/trpc/router"; // Fixed import statement Outcome: Changing the import statement to explicitly indicate a type-only import solved the problem. I hope this helps anyone facing a similar issue with setting up tRPC in an Astro project with React Islands. If it is a potential issue, I'm happy to help and provide more information |
Beta Was this translation helpful? Give feedback.
The issue was with the transformer variable with superjson being exported use to init tRPC. Importing and using directly superjson solved the issue.