Javascript – In Next.js Production build: how to throw Error() from Next.js server to trigger a catch() in a Client component?
Here is the simplified code of our Next.js 14 project: // path/to/action.ts "use server"; import AuthApi from "@/src/api/auth/auth-api"; export const submitForm = async (payload: any) => { try { const response: any = await AuthApi.login(payload); return { status: response.data.code, data:…