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

New "minimal builds" (import Rules) don't seem to work #844

Closed
escapedcat opened this issue Sep 22, 2017 · 4 comments
Closed

New "minimal builds" (import Rules) don't seem to work #844

escapedcat opened this issue Sep 22, 2017 · 4 comments
Labels
🐛 bug Unintended behavior

Comments

@escapedcat
Copy link
Contributor

Versions:

  • VueJs: 2.4.4
  • Vee-Validate: 2.0.0-rc.17
  • Version 63.0.3219.0 (Official Build) canary (64-bit)

Description:

Described in rc15 is a way to import single rules to keep the build small. This doesn't seem to work.

Steps To Reproduce:

Using the description given in the docs:

import Vue from 'vue';
import VeeValidate from 'vee-validate/dist/vee-validate.minimal';
import { Rules } from 'vee-validate';

Vue.use(VeeValidate);

// add the required rule
VeeValidate.Validator.extend('required', Rules.required);

I get this in the console:

"export 'Rules' was not found in 'vee-validate'

It could be that something in my code is wrong. I tried to find soem sort of export statement in the vee-validate.js which might export Rules in a way but couldn't find any. But that could also be caused by my misunderstanding of the codebase.

If this is working fine for anyone in here just close this issue please and I will dig into a bit more on my side.

@logaretm logaretm added the 🐛 bug Unintended behavior label Sep 23, 2017
@logaretm
Copy link
Owner

Thanks for reporting this, This is a bug caused by Rules not being exported correctly by the plugin, Should be released in the next version. Sorry about that, I will release a quick fix today or tomorrow.

@vfportero
Copy link

When are this fix planned to be deployed?

@escapedcat
Copy link
Contributor Author

@vfportero this is already fixed, we are using it in our current project, see:
https://github.com/baianat/vee-validate/releases/tag/2.0.0-rc.18

@vfportero
Copy link

@escapedcat I'm using typescript and the Rules object is not being declared on the vee-validate.d.ts file. The only way to make it work is using the Validator.rules object and making a cast:

(Validator.rules as any).email(value.trim()) //Validates the email trimmed

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

3 participants