Open bibauporto opened 1 month ago
Can you provide more context on your use case? Elysia doesn't support with tRPC adapter, maybe perhaps you meant tRPC plugin?
export const app = new Elysia()
.use(
cors({
origin: process.env.ORIGIN?.split(','),
}),
)
//not working
.use(trpc(appRouter, { createContext }))
// working version:
// .all('/trpc/*', async (opts) => {
// const res = await fetchRequestHandler({
// endpoint: '/trpc',
// router: appRouter,
// req: opts.request,
// createContext,
// })
// return res
// })
"cookies": [],
"content": {
"mimeType": "application/json",
"size": 795,
"text": "[{\"error\":{\"message\":\"No \\\"mutation\\\"-procedure on path \\\"users.login\\\"\",\"code\":-32004,\"data\":{\"code\":\"NOT_FOUND\",\"httpStatus\":404,\"stack\":\"TRPCError: No \\\"mutation\\\"-procedure on path \\\"users.login\\\"\\n at new TRPCError (C:\\\\00_Projects\\\\main\\\\node_modules\\\\@elysiajs\\\\trpc\\\\dist\\\\index.mjs:52:5)\\n at callProcedure (C:\\\\00_Projects\\\\main\\\\node_modules\\\\@elysiajs\\\\trpc\\\\dist\\\\index.mjs:308:15)\\n at <anonymous> (C:\\\\00_Projects\\\\main\\\\node_modules\\\\@elysiajs\\\\trpc\\\\dist\\\\index.mjs:859:24)\\n at inputToProcedureCall (C:\\\\00_Projects\\\\main\\\\node_modules\\\\@elysiajs\\\\trpc\\\\dist\\\\index.mjs:856:37)\\n at map (:1:11)\\n at <anonymous> (C:\\\\00_Projects\\\\main\\\\node_modules\\\\@elysiajs\\\\trpc\\\\dist\\\\index.mjs:971:28)\\n at processTicksAndRejections (:12:39)\",\"path\":\"users.login\"}}}]"
},
What version of Elysia is running?
Latest
What platform is your computer?
W11
What steps can reproduce the bug?
Using tRPC plugin.
What is the expected behavior?
tRPC
What do you see instead?
tRPC mitation/query does not exist
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?Yes