Code Monkey home page Code Monkey logo

Comments (7)

JNeutron avatar JNeutron commented on September 26, 2024 4

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.

dpilafian avatar dpilafian commented on September 26, 2024

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.

JoseOrtiz avatar JoseOrtiz commented on September 26, 2024

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.

dpilafian avatar dpilafian commented on September 26, 2024

@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.

chimilord avatar chimilord commented on September 26, 2024

Hi @JMGama, I have the same problem on a React app, did you find any workaround? Thanks.

from clabe-validator.

docdrue avatar docdrue commented on September 26, 2024

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);

Only this works for React project
import { clabe } from 'clabe-validator/dist/clabe.esm';

from clabe-validator.

dpilafian avatar dpilafian commented on September 26, 2024

Release v1.6.6

from clabe-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.