I'm getting a strange issue Unexpected token, expected ")" when trying to add the type as any of the exception e in the try-catch statement. Its working fine when any type is removed from the catch block. (Adding any explicitly as without it git pipeline fails)
try {
await axios.patch(
"/scriptschedule/" + pk + "/",
postData
);
setSubmitting(false);
afterCreateOrUpdateAction();
} catch (e: any) {
setSubmitting(false);
let message =
e.response.data && e.response.data.non_field_errors
? e.response.data.non_field_errors
: "Error. Please try again";
addToast({
id: "1",
title: "Error",
color: "danger",
text: <p>{message}</p>,
});
}
The syntax looks fine to me. Am I missing something?
