poppinss / indicative

Indicative is a simple yet powerful data validator for Node.js and browsers. It makes it so simple to write async validations on nested set of data.
https://indicative.adonisjs.com/
MIT License
417 stars 52 forks source link

Unable to use in web browser environment #96

Closed farcejofre closed 7 years ago

farcejofre commented 7 years ago

Hi, I'm using Indicative 2.2.1 in a React+Webpack web app project, and I'm unable to use it for client-side validations. Webpack is not failing while building, but when using it in the browser, indicative fails requiring pope in src/Messages/index.js. Probably related to using npmlog which, of course, is not available outside a node environment. I was finally able to use it in the browser by removing the dependency on pope, however I made a manual change for achieving this. If I keep on having indicative as a dependency, any changes in this sense will affect my application.

Do you need a test case for replicating this? Or would you prefer a pull request with the changes to keep using pope (npmlog) when available, and simply fail gracefully when it fails?

Thanks for an excellent piece of software!

thetutlage commented 7 years ago

Will be working towards a better build for browsers