Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.

These modules are missing... #17

Open
qynAUGMN opened this issue May 14, 2015 · 19 comments
Open

These modules are missing... #17

qynAUGMN opened this issue May 14, 2015 · 19 comments

Comments

@qynAUGMN
Copy link

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
Copy link
Owner

@qynAUGMN make sure you install the peer dependency Joi:

> npm install --save joi

@sebslomski
Copy link

Still not working for me

@sebslomski
Copy link

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

@qynAUGMN
Copy link
Author

👏

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
#17 (comment)
.

@jurassix jurassix reopened this May 15, 2015
@jurassix
Copy link
Owner

hapijs/joi#528 seems to suggest isemail is not supported by the browser and should be shimmed for the client.

@rbhalla
Copy link

rbhalla commented Jun 11, 2015

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

@real-ashwin
Copy link

Any workarounds?

@sebslomski
Copy link

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

@vguzev
Copy link

vguzev commented Aug 21, 2015

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
Copy link
Owner

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

@vguzev
Copy link

vguzev commented Aug 21, 2015

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
Copy link
Owner

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

Documentation for 5.0

@dminkovsky
Copy link

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

@dminkovsky
Copy link

PS. Haven't tested isemail-related functionality, but I followed hapijs/joi#528 (comment) and my bundle built with webpack. Wasn't aware of the node property in webpack config. Yay.

@jurassix
Copy link
Owner

jurassix commented Oct 9, 2015

@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
Copy link

+1

@dminkovsky
Copy link

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
Copy link

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
Copy link

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

hapijs/joi#665
hapijs/joi#768

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants