I'm currently implementing vee-validate version 3 with Vue 2.7 in my project. Specifically, this is the entry in my package.json file for vee-validate:
"vee-validate": "^3.4.5",
My issue lies with getting the required_if rule to function correctly. Whenever I attempt to use it, I encounter the following error:
Uncaught (in promise) Error: No such validator 'required_if' exists.
Below is a snippet of the code causing the error:
<ValidationObserver>
<ValidationProvider rules="" vid="country" v-slot="x">
<select v-model="country">
<option value="US">United States</option>
<option value="OTHER">Other country</option>
</select>
</ValidationProvider>
<ValidationProvider rules="required_if:country,US" v-slot="{ errors }">
<input type="text" placeholder="state" v-model="state" />
<span>{{ errors[0] }}</span>
</ValidationProvider>
</ValidationObserver>
This code closely resembles the example provided in the official documentation for the required_if rule on . I am at a loss as to why I am receiving this error despite following the given example.