Vee-validate: Cannot read property 'split' of null" found in .vue

Created on 15 Jun 2017  ยท  11Comments  ยท  Source: logaretm/vee-validate

Versions:

  • VueJs: #.#.#
  • Vee-Validate:

Description:

Error in directive validate bind hook: "TypeError: Cannot read property 'split' of null" found in .vue

Steps To Reproduce:

โ“ more information needed

Most helpful comment

@Blueblau @next tag was deprecated a long time ago, a lot has changed since beta.14 so give it a try without any tags.

npm install vee-validate

All 11 comments

I'm guessing that your v-validate prop has a value of null. If you want to temporarily disable validation on a field, set its v-validate prop to an empty string.

<input v-model="test" v-validate="''" />

I need a little more than that in order to help you. what does your template look like?

You have a mistake in a code by definition of name
_createClass(ListenerGenerator, [{
...
return this.binding.expression || this.el.name

this name (fieldName) use in this.vm.$validator.attach as name attach
and this.binding.expression for example it is equal 'required'

the same problem troubled me again.

@prp632791853 Can you provide a small snippet that produces the issue? As simple as you can.

I have the exact same error.

Installed the @next version, setup Vue to use VeeValidate and set the v-validate, from the linked example from the bottom of the docs.

<input type="email" v-model="userDetails.email" v-validate="userDetails.email" data-rules="required|email" placeholder="Email">

I also tried with the example from the doc:

<input v-validate="'required|email'" type="text" name="email">

Which gave the same error:

[Vue warn]: Error in directive validate bind hook: "TypeError: Cannot read property 'split' of null"

UPDATE:
I now tried with the example from here, with the same result.

@Blueblau @next tag was deprecated a long time ago, a lot has changed since beta.14 so give it a try without any tags.

npm install vee-validate

@logaretm I actually tried the normal version first, but got another error:

[Vue warn]: Error in mounted hook: "Error: [vee-validate]:

Again using the example from Hootlex, linked to above.

Hootlex example is outdated, the usage changed multiple times since then sadly.

try this example instead:

<div class="column is-12">
    <label class="label" for="email">Email</label>
    <p :class="{ 'control': true }">
        <input v-validate="'required|email'" :class="{'input': true, 'is-danger': errors.has('email') }" name="email" type="text" placeholder="Email">
        <span v-show="errors.has('email')" class="help is-danger">{{ errors.first('email') }}</span>
    </p>
</div>

Note that data-rules and data-vv-rules has been deprecated, you define rules in the directive expression instead, sorry about that.

Okay. Thanks.
You might wanna remove it from the docs then.

LOL,LOL,LOL,LOL

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yyyuuu777 picture yyyuuu777  ยท  3Comments

parweb picture parweb  ยท  3Comments

schel4ok picture schel4ok  ยท  3Comments

ash0080 picture ash0080  ยท  3Comments

saintplay picture saintplay  ยท  3Comments