Zod - instanceof z.ZodError

    try {
      coursePOST.body.parse(requestBody);
    } catch (error) {
      if (error instanceof z.ZodError) {
        setError(error.issues[0].message);
      }
      return;
    }


For some reason, the error is not being recognized as an instanceof Zod and I have no idea why. Anything wrong I am not seeing?
Was this page helpful?