Open exKAZUu opened 1 month ago
I can confirm my app works well just by updating https://github.com/elysiajs/elysia-trpc/blob/main/package.json#L14-L15 to 11.0.0-rc.477
.
However, there are some type errors related to app.ws
. (I just removed them because my app doesn't use ws ...)
I'm also running into the same issue when using v11
I ran into the issue as well, here's a React frontend with an Elysia server and a separate Express server that you can switch between to see the Elysia version errors: https://github.com/brandon-schabel/elysia-trpc-error
Hopefully it helps, thank you
There's a workaround with tRPC fetch adapter
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";
...
export const app = new Elysia()
.use(
cors({
origin: process.env.ORIGIN?.split(','),
}),
)
// not working
// .use(trpc(appRouter, { createContext }))
.all('/trpc/*', async (opts) => {
const res = await fetchRequestHandler({
endpoint: '/trpc',
router: appRouter,
req: opts.request,
createContext,
})
return res
})
@neocoder Thanx for the workaround, it works but only if I send request via Postman, with my code I get 400 as bad request (Failed to parse body). Anyone know maybe what could cause that? It all worked fine at some point with v11 rc 200ish.
What is the problem this feature would solve?
The current elysia (
1.1.0
of@elysiajs/trpc
) seems not to support tRPC v11. If I just bump@trpc/server
and@trpc/client
from10.45.2
to11.0.0-rc.477
, it causes the following error:If you need, I can create a repoduction repo.
What is the feature you are proposing to solve the problem?
Make
@elysiajs/trpc
support the latest tRPC (v11).What alternatives have you considered?
No response