CraftzCode
CraftzCode
TtRPC
Created by CraftzCode on 4/1/2025 in #❓-help
Prefetching with tRPC: Using hono.js/Express adapter and Next.js
If I use Hono.js or Express as the adapter for tRPC and my frontend is Next.js, will I be able to utilize the prefetch features referenced in Set up with React Server Components
1 replies
TtRPC
Created by CraftzCode on 3/31/2025 in #❓-help
What is the best approach when using monorepo with tTPC
What is the best approach when configuring tRPC inside of monorepo? I would like it to be used in Next.js, I create an internal library for tRPC example packages/api so I can call it anywhere in monorepo, now I would like to know where exactly is the best place for the client.tsx and for the tRPC caller for Server Components which is the server.tsx can I place it also inside of the internal library of tRPC or I will place it inside of Next.js which is on apps/web.
1 replies
TtRPC
Created by CraftzCode on 3/31/2025 in #❓-help
Troubleshooting createTRPCOptionsProxy with Server Components and Context Passing
No description
1 replies
TtRPC
Created by CraftzCode on 3/30/2025 in #❓-help
Integrating hono.js with tRPC in Next.js: Routing and Context Considerations
I want to combine Hono.js with tRPC. I followed the guide on the 3rd party middleware made by hono for a tRPC server, and now I have set up the hono tRPC server 3rd party middleware similar to the code below:
import { Hono } from 'hono'
import { trpcServer } from '@hono/trpc-server' // Deno 'npm:@hono/trpc-server'
import { appRouter } from './router'

const app = new Hono()

app.use(
'/trpc/*',
trpcServer({
router: appRouter,
})
)

export default app
import { Hono } from 'hono'
import { trpcServer } from '@hono/trpc-server' // Deno 'npm:@hono/trpc-server'
import { appRouter } from './router'

const app = new Hono()

app.use(
'/trpc/*',
trpcServer({
router: appRouter,
})
)

export default app
Now, where should I place this code in Next.js? Should it go in app/api/[[...route]]/route.ts or in app/api/trpc/[trpc]/route.ts? Also, what is the best approach regarding context—should I use the tRPC context or the Hono.js context?
21 replies