kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

Vue 2.2.1+ compatibility with regard to Vue.util usage #357

Open karaoak opened 7 years ago

karaoak commented 7 years ago

As per release 2.2.0 of Vue (https://github.com/vuejs/vue/releases):

Many exposed methods and properties on Vue.util have been removed. If you previously relied on them, you should migrate off of them since this object is intended for internal use only - it is not (and has never been) considered part of the public API and may change without notice in the future.

and because vue-validator 3 is using some Vue.util methods in many places, my Vue.js application compiled with Vue 2.2.1 is no longer working. it throws the following error:

vue.common.js?e881:422 TypeError: resolveAsset is not a function at VueComponent._resolveValidator (eval at (http://my.app.dev:5000/js/app.js:6019:1), :1476:12) at VueComponent.boundFn [as _resolveValidator] (eval at (http://my.app.dev:5000/js/app.js:6026:1), :126:14) at VueComponent._getValidateRawDescriptor (eval at (http://my.app.dev:5000/js/app.js:6019:1), :1484:22) at VueComponent.boundFn [as _getValidateRawDescriptor] (eval at (http://my.app.dev:5000/js/app.js:6026:1), :125:14) at VueComponent._validate (eval at (http://my.app.dev:5000/js/app.js:6019:1), :1680:27) at VueComponent.boundFn [as _validate] (eval at (http://my.app.dev:5000/js/app.js:6026:1), :125:14) at eval (eval at (http://my.app.dev:5000/js/app.js:6019:1), :1777:22) at Array.forEach (native) at VueComponent.validate (eval at (http://my.app.dev:5000/js/app.js:6019:1), :1776:18) at VueComponent.boundFn [as validate] (eval at (http://my.app.dev:5000/js/app.js:6026:1), :127:12)

When looking at the vue-validator 3.0 library Vue.util is used in many places. Unfortunately I don't have the knowledge at this moment to create an alternatives for the Vue.util methods as used in your code.

For this reason, I would like to ask you if this is a known issue and what the timeline could be to resolve :-) this issue.

Thanks for your great library.

kazupon commented 7 years ago

Thank you for your filling!

It's exactly as you said, vue-validator is using Vue.util. The most problematic one to be resolveAsset of Vue.util. To achieve this same thing, maybe, it will take time. Also, I'm sorry indeed, I might not be able to promise official release.

If you want to use the other validation library, I recommend vuelidate. This library is model based and already many users using it, and it's superior than vue-validator in some ways.

Thank you for taking time for vue-validator. :bow:

karaoak commented 7 years ago

Hi Kazuya,

Thanks for your swift reply! Bummer, I really your vue-validator. We use it in our project (not live yet) extensively. Thanks for your vuelidate tip. I might look into this.

Thanks agains, regards, Frank

towry commented 7 years ago

@kazupon Hi, it seems isPlainObject not work too. Vue.utils doesn't have a isPlainObject method.

I think I have to switch to another validation library, can't wait.

woshi82 commented 7 years ago

@karaoak any update? i like this frame because of the elegant coding in my project