Brokenwind
Brokenwind3w ago

Next JS error handling.

I'm having this weird error in Next dev whenever I throw an error in a router.
login: publicProcedure.input(loginSchema).mutation(async ({ ctx, input }) => {
const { error } = await ctx.supabase.auth.signInWithPassword({
email: input.email,
password: input.password,
});

if (error) {
throw new TRPCError({ code: "UNAUTHORIZED", message: error.message });
}
}),
login: publicProcedure.input(loginSchema).mutation(async ({ ctx, input }) => {
const { error } = await ctx.supabase.auth.signInWithPassword({
email: input.email,
password: input.password,
});

if (error) {
throw new TRPCError({ code: "UNAUTHORIZED", message: error.message });
}
}),
Am I handling it correctly in the first place? onError works fine but this error in the dev tool is worrying.
No description
4 Replies
malviys
malviys2w ago
I'm getting same error, @Brokenwind is it resolved?.
Brokenwind
BrokenwindOP2w ago
As far as I know, nope
malviys
malviys7d ago
@Brokenwind , I debugged issue and removed loggerLink and it's working fine
No description
No description
Brokenwind
BrokenwindOP7d ago
Thanks for this!

Did you find this page helpful?