1

When trying to get form data I am getting the following error in console:

vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'validate' of undefined
at _callee$ (AddProduct.vue?eb76:67)
at tryCatch (runtime.js?96cf:63)
at Generator.invoke [as _invoke] (runtime.js?96cf:293)
at Generator.eval [as next] (runtime.js?96cf:118)
at asyncGeneratorStep (asyncToGenerator.js?1da1:3)
at _next (asyncToGenerator.js?1da1:25)
at eval (asyncToGenerator.js?1da1:32)
at new Promise (<anonymous>)
at eval (asyncToGenerator.js?1da1:21)
at VueComponent.addProduct (AddProduct.vue?eb76:67)

My VueJs component : https://pastebin.com/9v2bsEaP

It emits and event that is called from AppVue. This is it: https://pastebin.com/FrNzzCn4

I suspect this is caused by validation but I cannot figure out what I miss. Thank you for looking.

1 Answer 1

0

I suspect your vee validate isn't instantiated properly. Please if you can read this article: Validation in vue js using vee-validate having error it may help you in the correct direciton.

I checked your code and cant see the import statement as mentioned in the last answer posted in that thread.

Sign up to request clarification or add additional context in comments.

3 Comments

It is imported in main.js like : import VeeValidate from "vee-validate"; Vue.use(VeeValidate);
you need to import it like so import * as VeeValidate from 'vee-validate';
Unfortunately this did not change the error message. Thanks for looking, anyway.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.