Mutations on the trpc functions is throwing ["ERR_INTERNAL_ASSERTION"], queries are working fine.
Why are my mutations not working as they should ? The tRPC mutation function I call does not execute any lines of code inside that, it just throws the internal assertion error after few seconds. My setup is correct I feel as all the queries work fine, but the mutations dont.
1 Reply
Hey y'all,
export const userRouter = createTRPCRouter({
registerUser: publicProcedure
.input(z.object({email: z.string(), password: z.string(), confirmPassword: z.string()}))
.mutation(async (opts) => {
const {input, ctx: {db}} = opts;
const {email, password} = input;
const result = await db.user.create({data: {email, password}})
return result
}),
});
So, I was able to resolve this error, by removing the console. Yes, by removing the console. But I dont understand why is the console causing this error ??