vee-validate icon indicating copy to clipboard operation
vee-validate copied to clipboard

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

Open shurfee opened this issue 9 years ago • 9 comments

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:

shurfee avatar Nov 20 '17 14:11 shurfee

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

logaretm avatar Nov 20 '17 14:11 logaretm

Sure. Is this enough?

vee-validate

shurfee avatar Nov 20 '17 14:11 shurfee

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

logaretm avatar Nov 20 '17 14:11 logaretm

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 avatar Nov 20 '17 15:11 ThomHurks

@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.

logaretm avatar Nov 20 '17 17:11 logaretm

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

ThomHurks avatar Nov 20 '17 17:11 ThomHurks

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

dmitriie-brd avatar Nov 20 '17 19:11 dmitriie-brd

closed in rc.23

logaretm avatar Nov 20 '17 22:11 logaretm

hello world

2769842232 avatar Jul 02 '19 13:07 2769842232