Problem:
onSubmit handler has a catch block:
} catch (err) { if (onError) { const messages = err.errors.map((e) => e.message).join("\n"); onError(modelFields, messages); } }
err does not necessarily have an errors attribute, which will result in an error thrown: TypeError: Cannot read properties of undefined (reading 'map').