Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in console when using URL validator rule in RC4 #516

Closed
ThomHurks opened this issue May 26, 2017 · 3 comments
Closed

Errors in console when using URL validator rule in RC4 #516

ThomHurks opened this issue May 26, 2017 · 3 comments
Labels
🐛 bug Unintended behavior

Comments

@ThomHurks
Copy link
Contributor

Versions:

  • VueJs: 2.3.3
  • Vee-Validate: 2.0.0-rc.4

Description:

When using the URL validator rule, I get errors in the browser console each time you type anything in the input. The input does correctly validate though.

Steps To Reproduce:

I have an input:

<input name="url" :value="value" v-on:input="$emit('input', $event.target.value)" v-validate.initial="'required|url|max:255'" type="text" placeholder="URL">

When I type in the input, I get errors in the console on each keystroke. However, the input does seem to validate correctly.

The "value" here is a prop (we're inside a custom component) that is a string. This worked correctly in RC3 and except for the console errors, still seems to work correctly in RC4.

The errors look like this:

vee-validate.js?d4ab:171 Uncaught TypeError: This library (validator.js) validates strings only
    at assertString (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:171:11)
    at isURL (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:755:30)
    at url (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:852:16)
    at Validator._test (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:2171:16)
    at eval (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:2566:27)
    at Array.map (native)
    at Validator.validate (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:2565:51)
    at ListenerGenerator._validate (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:3135:29)
    at eval (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:3253:12)
    at Proxy.eval (eval at <anonymous> (https://foo.localhost/js/app.js:494:1), <anonymous>:1180:20)
@ThomHurks ThomHurks changed the title Errors in console when using URL validator rule Errors in console when using URL validator rule in RC4 May 26, 2017
@logaretm logaretm added 🐛 bug Unintended behavior and removed 🐛 bug Unintended behavior labels May 26, 2017
@logaretm
Copy link
Owner

Okay I think it is related to your other issue #515, its trying to validate an array instead of a string, should be fixed in that commit.

@logaretm
Copy link
Owner

logaretm commented May 26, 2017

Just tagged rc.5, since this issue is critical.

working fiddle with new version here:

https://jsfiddle.net/fL243o01/

Thanks for the feedback!

@logaretm logaretm added the 🐛 bug Unintended behavior label May 26, 2017
@ThomHurks
Copy link
Contributor Author

@logaretm I can confirm that it now works with RC5. Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants