jurassix / react-validation-mixin

Simple validation mixin (HoC) for React.
MIT License
283 stars 38 forks source link

These modules are missing... #17

Open qynAUGMN opened 9 years ago

qynAUGMN commented 9 years ago

ERROR in ./~/joi/lib/string.js Module not found: Error: Cannot resolve module 'net' in /Users/russell/Work/augmn/tcms/node_modules/joi/lib @ ./~/joi/lib/string.js 3:10-24

ERROR in ./~/joi/~/isemail/lib/isemail.js Module not found: Error: Cannot resolve module 'dns' in /Users/russell/Work/augmn/tcms/node_modules/joi/node_modules/isemail/lib @ ./~/joi/~/isemail/lib/isemail.js 1188:18-32

jurassix commented 9 years ago

@qynAUGMN make sure you install the peer dependency Joi:

> npm install --save joi
sebslomski commented 9 years ago

Still not working for me

sebslomski commented 9 years ago

This issue seems appear only with webpack. I forked isemail and removed the unneeded stuff (http://github.com/travelio/node-isemail)

qynAUGMN commented 9 years ago

👏

On Friday, May 15, 2015, Sebastian Slomski notifications@github.com wrote:

This issue seems appear only with webpack. I forked isemail and removed the unneeded stuff (travelio/isemail)

— Reply to this email directly or view it on GitHub https://github.com/jurassix/react-validation-mixin/issues/17#issuecomment-102370375 .

jurassix commented 9 years ago

https://github.com/hapijs/joi/issues/528 seems to suggest isemail is not supported by the browser and should be shimmed for the client.

rbhalla commented 9 years ago

@sebslomski How would you go about using this branch with Joi? Also how did you deal with the net dependency.

real-ashwin commented 9 years ago

Any workarounds?

sebslomski commented 9 years ago

As @jurassix mentioned, hapijs/joi#528 solves the problem.

vguzev commented 9 years ago

I just installed node-libs-browser and added these lines to webpack.config:

node: {
 net: 'empty',
 tls: 'empty',
 dns : 'empty'
}

Messages about missing 'net' and 'dns' modules now disappeared, but now I'm getting:

ERROR in chunk main [entry]
js/bundle.js
No template for dependency: TemplateArgumentDependency

And it breaks build process of webpack. Any other ideas?

P.S. As joi is not usable with webpack is it possible to switch to other validation libraries (business-rules-engine?)?

jurassix commented 9 years ago

@vguzev - currently this library only supports Joi; support for other validation engines will be available in the next major release.

vguzev commented 9 years ago

Sounds promising, but I'm afraid that we'll have to switch to something else before this release is available. I'm currently evaluating React validation modules for one big project. According to README.md react-validation-mixin is actually what we need, but I can't even evaluate it as it is not compatible with webpack... ((

P.S. I think you should define some kind of "interfaces" for validation engines, so they could be pluggable.

jurassix commented 9 years ago

@vguzev you can now write your own strategy as of 5.0

Documentation for 5.0

dminkovsky commented 8 years ago

How do you guys use this if not with webpack? I imagine browserify would have the same issues as webpack?

dminkovsky commented 8 years ago

PS. Haven't tested isemail-related functionality, but I followed https://github.com/hapijs/joi/issues/528#issuecomment-74263885 and my bundle built with webpack. Wasn't aware of the node property in webpack config. Yay.

jurassix commented 8 years ago

@dminkovsky I use Browserify. The DEMO is also built using Browserify and emails validate correctly without any shims.

I'll add a synopsis to the documentation for webpack so this information is straightforward to find for the next users.

dsteinbach commented 8 years ago

+1

dminkovsky commented 8 years ago

Hi @jurassix. Thanks for that. I've also got emails validating with my webpack build. Doesn't do the whole DNS bit but that's what it is in the client without trying to get fancy.

By the way, thanks for this module. A while back I opened an issue in the Ampersand repository basically suggesting this very module. Thanks for making this happen :).

sgentile commented 8 years ago

I'm also using webpack and getting the same errors.

ERROR in ./~/joi/lib/string.js Module not found: Error: Cannot resolve module 'net' in ....node_modules/joi/lib @ ./~/joi/lib/string.js 5:12-26

ERROR in ./~/isemail/lib/index.js Module not found: Error: Cannot resolve module 'dns' in .../node_modules/isemail/lib @ ./~/isemail/lib/index.js 5:12-26

idealistic commented 8 years ago

I had to add the following to my webpack config for my node app to get rid of those errors.

https://github.com/hapijs/joi/issues/665 https://github.com/hapijs/joi/issues/768

        node: {
          net: 'empty',
          tls: 'empty',
          dns: 'empty'
        },