Nuxt.js: Vee-Validate module not working on server side

Created on 14 Feb 2017  路  6Comments  路  Source: nuxt/nuxt.js

Hi, i use module Vee-Validate

nuxt.config.js

plugins: ['~plugins/vue-validate']

vue-validate.js

import Vue from 'vue'
import VeeValidate from 'vee-validate'

Vue.use(VeeValidate)

on server render error

500

Cannot read property '$validator' of undefined

why???

This question is available on Nuxt.js community (#c219)
question

All 6 comments

@wargt I too faced the same issue. I switched to Vuelidate

@shyamchandranmec I'm having issues with Vuelidate too! Getting a "Cannot read property 'error' of undefined" when navigating between pages, including Vuelidate on every page seems to fix the issue, but isn't ideal.

Hi, it will be fixed in the new version of vee-validate: more info

hi, when i use vee-validate methods on ssr throw those errors. ( like: errors.has('mail') )

"nuxt": "^1.0.0-alpha.5"
"vee-validate": "^2.0.0-rc.7"

[Vue warn]: Property or method "errors" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

[Vue warn]: Error in render function: "TypeError: Cannot read property 'has' of undefined"

any idea...

<label class="label">Email (1s delay)</label>
<p class="control has-icon has-icon-right">
<input name="mail" v-validate="'required|mail'" data-vv-delay="1000" :class="{'input': true, 'is-danger': errors.has('mail') }" type="text" placeholder="Email">
<i v-show="errors.has('mail')" class="fa fa-warning"></i>
<span v-show="errors.has('mail')" class="help is-danger">{{ errors.first('mail') }}</span>
</p>

@MustafaDal I have the same problem when I add VeeValidator only to local component. When I added it global everything was fine.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jaredreich picture jaredreich  路  3Comments

surmon-china picture surmon-china  路  3Comments

danieloprado picture danieloprado  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

shyamchandranmec picture shyamchandranmec  路  3Comments