tRPC standalone server in monorepo

Hi, I'm using t3-stack monorepo as my base and I've swapped out NextJS backend for standalone HTTP server but I just can't get it work Discord wouldn't let me post the code as it was too long so I've uploaded the api.ts and client.ts along with the error to gist https://gist.github.com/neo773/7c8a314785d5e4f54c724cde7e5fa65c
Gist
tRPC standalone server in monorepo
tRPC standalone server in monorepo. GitHub Gist: instantly share code, notes, and snippets.
N
Nick388d ago
What doesn’t work? What errors/output?
N
NEO388d ago
Check the third file in gist for the error That’s what I get at this line
export const trpc = createTRPCReact<AppRouter>()
export const trpc = createTRPCReact<AppRouter>()
N
Nick388d ago
Oh are you running all the latest & exact same versions of tRPC dependencies? That's a new response code we added I think, it's important to keep versions in line
N
NEO388d ago
Yes, as I said before I’m using t3 stack monorepo template and the server and client have the same version of trpc
N
Nick388d ago
Maybe worth nuking the lock file just to be sure. I’m on the move now so can have another look over later, but it reads like a version mismatch
N
NEO388d ago
Turns out it was the package manager bun, installing the deps with pnpm worked fine
N
Nick388d ago
It always seems to be bun
N
NEO388d ago
They had a new update recently which added support for workspaces so I thought I'd give it a shot, anyway thanks for looking.
N
Nick388d ago
Yeah it's a really exciting project, just quite early days and many people have come in with strange issues later found to be Bun's fault Glad you sorted it 🙂
More Posts
Codemod to v10 is not modifying any fileHello 👋, I must be super dumb but running `pnpm dlx trpc-v10-migrate-codemod ` in my project isn't No overload matches this call when outputting unionsHello there 👋, I have this simple procedure (we're not fully migrated on v10 yet, using interop): [help] Uncaught (in promise) TRPCClientError: Property description must be an object: uAfter building on linux, I visit the site. And Chrome console shows this error. But if I build on myHow can I make tRPC+NextJs APIs faster? (db and functions region is already same)Hi, I have migrated my website backend (https://clubofcoders.com) from NestJs + Prisma + Cloud Run tThrowing fastify errors when using fastify adapterHello, I'm using `fastifyTRPCPlugin` from `@trpc/server/adapters/fastify` and trying to throw errorsConfused about createProxySSGHelpersIf you can use this helper inside of `getServerSideProps` without having `ssr: true` what is the difHow to check if data is being prefetched?What is a method to check if ssg prefetching actually occurs? Through the network tab?How can I access ctx from inside of a procedure?``` const appRouter = t.router({ helloTab: t.procedure.input(z.object({ url: z.string().url() })).Async User Call in `createContext` (context.ts) or in `isAuthed` (in trpc.ts)Hi all! Should I be getting the user in all requests via createContext in the following async call `'req' of undefined in onError of express middlewareI've recently noticed that I get a bunch of errors regarding req object missing in ctx for onError pMutations and Queries in React Contexts causing unexpected behaviorsIn my organization, we recently moved to put all of our mutations/queries into React Contexts and ouCustom error managementHey peeps! I could've sworn I created a GitHub issue about this, but I must've been dreaming, becauscontext questionWhy are the context examples only showing opinionated examples with next/react auth ? Also i find itasync middlewareis it possible to define an async middleware? I want to do something like this but it throws errors The type of the second route of the nested route is neverhttps://github.com/StringKe/nx-mulit-trpc-type-error/blob/main/apps/app1/src/pages/index.tsx#L12errorFormatter ignored when using appRouter.createCallerMy errorFormatter works correctly in the actual application using an adapter, e.g. ``` trpcExpress.Is there a way to define the Websocket protocol when using wsLink()I am attempting to use tRPC with Azure's Pub/Sub Websockets service it appears to require custom proThe inferred type of this node exceeds the maximum length the compiler will serialize.Hey, there I am running into this error when I have more than 12 routers in the mergeRouters functioQuickstart not workingHello there, There is a type error in the quickstart example if i'm not mistaken. I pretty much coUse TRPC function inside of a TRPC functionHi all! We have a trpc query called getProduct. I want to use this getProduct query inside of anothe