question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vue warn]: Error in render function: "TypeError: undefined is not an object (evaluating '_vm.errors.has')

See original GitHub issue

Versions:

  • VueJs: ^2.3.3
  • Vee-Validate: ^2.0.0-rc.3

Description:

While running the tests, I’m getting a warning, followed by a stack trace: [Vue warn]: Error in render function: "TypeError: undefined is not an object (evaluating ‘_vm.errors.has’)

found in —> <Hello> at /src/components/Hello.vue <Root>’

Since that above warning, test getting failed Hello.vue _ should render correct contents undefined is not a function (evaluating ‘vm.$el.querySelector(’.hello h1’)') webpack:///test/unit/specs/Hello.spec.js:8:32 <- index.js:10430:32 PhantomJS 2.1.1 (Linux 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.069 secs / 0.005 secs)

Steps To Reproduce:

step1: vue init webpack sample-veevalidation step2: cd sample-veevalidation step3: npm install step4: npm install vee-validate --save

step5: add below lines in src/main.js import VeeValidate from 'vee-validate' Vue.use(VeeValidate)

step6: add below lines in src/components/Hello.vue <input v-validate="'required|email'" type="text" name="email"> <span v-show="errors.has('email')">{{ errors.first('email') }}</span>

step7: npm run test

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
logaretmcommented, Jul 6, 2017

Okay I found the issue, if you import vee-validate and install it instead in the router/index.js file it should work correctly. this is very similar to this old issue #11 that only used to happen with Vue 1.0

router/index.js

import Vue from 'vue'
import VeeValidate from 'vee-validate'
import Router from 'vue-router'
import Hello from '@/components/Hello'

Vue.use(VeeValidate)
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Hello',
      component: Hello
    }
  ]
})

I will try to figure the reason behind it, but the workaround works perfectly.

0reactions
Thavaprakashcommented, Jul 13, 2017

@logaretm Thank you, your workaround works fine. 😃 Sorry for late reply.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Vue warn]: Error in render: "TypeError: undefined is not an ...
javascript - [Vue warn]: Error in render: "TypeError: undefined is not an object (evaluating 'this. $store. state')" - Stack Overflow. Stack ...
Read more >
Vue warn]: Error in render: "TypeError: undefined is not an ...
Coding example for the question [Vue warn]: Error in render: "TypeError: undefined is not an object (evaluating 'this.$store.state')"-Vue.js.
Read more >
Error in render function: "TypeError: products is undefined ...
[solved] [Vue warn]: Error in render function: "TypeError: products is undefined" Typically this means that some variable (X) is not defined ...
Read more >
undefined is not an object (evaluating 'func.apply') - You.com
this is a keyword in JavaScript that is a property of an execution context. Its main use is in functions and constructors. The...
Read more >
vuejs/vue - Gitter
And you can even use JSX in Vue with render functions (instead of ... I'd rather not have to have my server render...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found