question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning [vee-validate] rules must be either a string or an object

See original GitHub issue

Versions:

  • VueJs: 2.5.16
  • Vee-Validate: 2.1.0-beta.5

Description:

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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
logaretmcommented, Jul 4, 2018

Thanks for the small demo, it was resolved and should be up in the next release.

2reactions
dirqcommented, Jul 2, 2018

I get the same thing. Here’s my config:

<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vee-validate@2.1.0-beta.5/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);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom Rules - VeeValidate
This validator object must have a validate method and can contain a getMessage method which will be merged into the current dictionary locale....
Read more >
Rules Object Expression - VeeValidate
This rules object expression like the name suggests, uses JavaScript/JSON objects to define validation rules and generally is much more powerful than string...
Read more >
Error Messages - VeeValidate
They can be either strings or functions that return a string called generators. ... WARNING. You must provide the messages in an object...
Read more >
Available Rules - VeeValidate
The field under validation must have exactly have the specified number of items, only works for iterables. Allowed Iterable values are: string ,...
Read more >
Validation Provider - VeeValidate
The fields being validated must have a v-model so the component can correctly ... failedRules, [x: string]: string, A map object of failed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found