I'm getting the following warning every time I refresh my page.
Warning [vee-validate] rules must be either a string or an object
It started when I updated my VeeValidate to the beta one. In the 2.0.9 it won't show the warning.
I've already checked the entire code looking for some miss use off v-validate but it's all correct (I'm using object form).
Can someone help me?
Thanks!
Can you share the code that triggers this warning? Even better if you can produce it in an online demo to make easier for me to debug or point out any mistakes.
Well, the problem is that my project is huge.
I'll try to reproduce the warning on codepen or create a simple project with my configurations and see if it still heapens.
I get the same thing. Here's my config:
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vee-validate.js"></script>
var validationConfig = {
aria: true,
classes: true,
delay: 100,
locale: 'en',
strict: true,
validity: false,
dictionary: {
en: {
messages: {
required: function(fieldName) {
return fieldName + ' is required.';
},
regex: function(fieldName) {
return 'Please enter a valid ' + fieldName.toLowerCase();
}
}
}
}
};
VeeValidate.Validator.extend('us-phone', {
getMessage: function() {
return 'Please enter a valid US phone number like 202-555-0171.';
},
validate: function(value) {
return !!value.match(/^(\d{3})?\-?(\d{3})\-?(\d{4})$/);
}
});
Vue.use(VeeValidate, validationConfig);
I made a simples CodePen where the VeeValidate fires the warning.
Thanks for the small demo, it was resolved and should be up in the next release.
Most helpful comment
Thanks for the small demo, it was resolved and should be up in the next release.