Comments (7)
Hi @JMGama, I have the same problem on a React app, did you find any workaround? Thanks.
I solved importing like this in a Vue project:
import { clabe } from 'clabe-validator/dist/clabe.esm'
from clabe-validator.
The error message means that clabe
is not set at all, which implies that the import
statement did not work.
Make sure you have the latest version installed:
npm install clabe-validator@latest
Then add a simple debug line to verify the import
statement is working:
console.log(clabe);
from clabe-validator.
Same here, on a VueJs project, clabe
is undefined and this is an error
can't access property "validate", clabe_validator__WEBPACK_IMPORTED_MODULE_4__.clabe is undefined
from clabe-validator.
@JoseOrtiz It's possible that WebPack is confused. Maybe you need to put the clabe-validator import statement earlier. Another Vue user had a similar problem: https://stackoverflow.com/a/35240717/1553812
What does your import look like in Vue? Are you using the old CommonJS/UMD require
statements or the new ES6 module import
statements? I'm not familiar with Vue, so I'm not even sure exactly what questions to ask.
clabe-validator is configured to support both the old CommonJS/UMD and the new ES6 Modules:
"main": "dist/clabe.umd.cjs",
"module": "dist/clabe.esm.js",
https://github.com/center-key/clabe-validator/blob/master/package.json#L7-L8
You may even want to post a question on StackOverflow -- sometimes you can get surprisingly fast answers there.
from clabe-validator.
Hi @JMGama, I have the same problem on a React app, did you find any workaround? Thanks.
from clabe-validator.
The error message means that
clabe
is not set at all, which implies that theimport
statement did not work.Make sure you have the latest version installed:
npm install clabe-validator@latest
Then add a simple debug line to verify the
import
statement is working:console.log(clabe);
Only this works for React project
import { clabe } from 'clabe-validator/dist/clabe.esm';
from clabe-validator.
Release v1.6.6
from clabe-validator.
Related Issues (20)
- Add Support for bank code 846 HOT 3
- Polyfill parseInt() for radix 10 or switch to Number() HOT 1
- Problem with cities HOT 3
- Update travis ci to node v12 HOT 2
- Switch to ES6 object method shorthand in clabe.js HOT 2
- Switch to trailing comma style in spec.js and gulpfile.js
- Valid clabe reported as invalid HOT 1
- Replace deprecated assert.deepStrictEqual() in spec.js
- Switch to trailing comma style in spec.js HOT 1
- Please add Hacktoberfest topic to the repo HOT 1
- Switch parseInt() with radix 10 to Number()
- Add JSHint rule to disallow var declarations
- Add JSHint rule to disallow invalid space characters
- SemVer not compliant package HOT 6
- Site appears to be broken HOT 1
- Invalid city code: 969 HOT 3
- Add new banks from Banco de México's list of institutions HOT 1
- Update list of city/region codes HOT 1
- Regular Expression Denial of Service HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clabe-validator.