Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

An error is always thrown #99

Closed
qt911025 opened this issue Nov 27, 2015 · 7 comments
Closed

An error is always thrown #99

qt911025 opened this issue Nov 27, 2015 · 7 comments

Comments

@qt911025
Copy link

<!-- head... -->
<body>
<div id="test2">
  <validator name="va">
    <form novalidate>
      <input type="text" v-validate:uname.required/>

    </form>

    <p v-if="$va.uname.required">Uname is required!</p>
  </validator>

</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script src="node_modules/vue-validator/dist/vue-validator.js"></script>
<script src="app.js"></script>
</body>
Vue.config.debug = true;

new Vue({
  el: '#test2'
})

An error "TypeError: scope.$va.uname is undefined" is thrown.

@kazupon
Copy link
Owner

kazupon commented Nov 27, 2015

Thank you for your reporting !!

I've checked your issue code in jsfiddle. However that issue did not occur the error in my environment.
Would you tell me the Vue.js version ?

@qt911025
Copy link
Author

It's v1.0.10.

Here's my demo.
https://github.com/qt911025/vue-validator-demo

In JSFiddle, there's another problem:
https://jsfiddle.net/freugaz2/3/

@kazupon
Copy link
Owner

kazupon commented Nov 30, 2015

Thanks !!
This is the bug.
I'll try to fix this issue until release v2.0

@kazupon
Copy link
Owner

kazupon commented Dec 9, 2015

Fixed in v2.0-alpha.6

jsfiddle:
https://jsfiddle.net/kazupon/7og9hds9/3/

@kazupon kazupon closed this as completed Dec 9, 2015
@qt911025
Copy link
Author

Hi, kazupon.
Your example works well but I think the problem is not resolved.
The error will not be thrown because of the use of minified Vue, from which the debug or error tracking tools(something like that) are removed. The example is still not work in development environment.

https://jsfiddle.net/7og9hds9/18/

I just replaced the minified vue with the raw one. Plz have a check.

@kazupon
Copy link
Owner

kazupon commented Dec 22, 2015

related #35 #103

@kazupon kazupon added improvement and removed bug labels Dec 22, 2015
@kazupon
Copy link
Owner

kazupon commented Dec 22, 2015

Sorry, I cannot find a solution to this issue yet.
This issue is difficult.

I'm asking the advise about related issue at below forum.

http://forum.vuejs.org/topic/957/how-to-avoid-evaluating-expression-warning-for-plugin-author

This issue is occuring when we using development version of vue.js

In development of app, we can avoid this issue by setting the Vue.config.warnExpressionErrors = false.

I'll try to write the README.md later. 😸

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants