You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loading ajv and ajv-errors from cdn and importing them into my javascript (no framework), but for some reason I still get default error messages from ajv instead of custom error messages that I have added to my json schema. Below is my frontend code. Note that in my Node.js backend ajv-errors works perfectly, so I know that problem is not in my schema or code. Does ajv-errors support esm at all?
import Ajv from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
import ajvErrors from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
const ajv = new Ajv({
allErrors: true,
strict: false
});
ajvErrors(ajv);
const validator = ajv.compile(mySchema);
const valid = validator(json);
if (!valid) {
console.log(validator.errors);
}
I'm loading ajv and ajv-errors from cdn and importing them into my javascript (no framework), but for some reason I still get default error messages from ajv instead of custom error messages that I have added to my json schema. Below is my frontend code. Note that in my Node.js backend ajv-errors works perfectly, so I know that problem is not in my schema or code. Does ajv-errors support esm at all?
You can see the problem on below page if you enter a number for the name fields and submit the form:
https://form-liart-five.vercel.app/
Source code available at:
https://github.com/smohadjer/form
The text was updated successfully, but these errors were encountered: