Vee-validate: Error in directive validate inserted hook: "TypeError: Cannot read property 'scope' of undefined"

Created on 20 Nov 2017  路  9Comments  路  Source: logaretm/vee-validate

Versions:

  • VueJs: 2.4.2
  • Vee-Validate: 2.0.0-rc.22

Description:

Problem is the same as in https://github.com/baianat/vee-validate/issues/639.
Downgrading to 2.0.0-rc.21 solved the problem.

Steps To Reproduce:

馃 needs reproduction

Most helpful comment

@ThomHurks Thanks! The errors in the screenshots originate from the inserted and update hooks, yours seem to fail in the bind hook. Not sure if they are the same problem or not.

I have pushed a small attempt to fix this at the master branch, also the main file is pre built so you can try it directly.

All 9 comments

Do you mind posting the stack trace or a small example so it can be fixed properly? the #639 does not produce the same issue when using rc.22

Sure. Is this enough?

vee-validate

Thanks, I also need the line that produces this error.

I'm also getting this. Validation seems to be completely broken for my Vue components.
[Vue warn]: Error in directive validate bind hook: "TypeError: Cannot read property 'scope' of undefined"

at Validator.update (vee-validate.esm.js:2085)
    at Field.update (vee-validate.esm.js:1299)
    at new Field (vee-validate.esm.js:1196)
    at Validator.attach (vee-validate.esm.js:2017)
    at bind (vee-validate.esm.js:2695)
    at callHook$1 (vue.common.js:6133)
    at _update (vue.common.js:6058)
    at Array.updateDirectives (vue.common.js:6039)
    at invokeCreateHooks (vue.common.js:5556)
    at createElm (vue.common.js:5447)

The line is

if (!isNullOrUndefined(field.scope) && this.flags[("$" + (field.scope))]) {

I could create a reproduction example if you need more information than this :)

@ThomHurks Thanks! The errors in the screenshots originate from the inserted and update hooks, yours seem to fail in the bind hook. Not sure if they are the same problem or not.

I have pushed a small attempt to fix this at the master branch, also the main file is pre built so you can try it directly.

I built the .esm file from master and with that it works! No more errors and validation seems to work fine now 馃憤 Thanks!

I'm waiting for a new release with fix :)

closed in rc.23

hello world

Was this page helpful?
0 / 5 - 0 ratings

Related issues

7immer picture 7immer  路  3Comments

MaxMilton picture MaxMilton  路  3Comments

Youdaman picture Youdaman  路  3Comments

HunterJS-bit picture HunterJS-bit  路  3Comments

schel4ok picture schel4ok  路  3Comments