-
-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile error the code inside var crypto = require('crypto'); TypeError: require is not a function #452
Comments
I ran into the same issue with a library that has formidable as dependency. add this to webpack config:
webpack will then skip over formidable and leave |
@tushar-singh not work with webpack4 |
@raphaelsoul, check migration guides. Closing since it's not a problem here, but outside this lib and probably in the tooling. We working on improving docs and in near future it may be better. @aiyld thanks for the report. If it is still a problem, feel free to open new issue. Cheers. |
Still an issue with webpack 4. Using externals entry doesn't work. Can't use the package. |
thanks! it works! |
Hmm on webpack 4.29.6 and up and adding the externals works |
2020, and the issue is still here :( Have to additionally configure all my projects.
Looks like it wont work after #539 ? |
@Diokuz did you try |
No, I didnt, because it is our subdependency. But the problem is still there in the latest version 1.2.2. |
Oh, I see. ;/
Yup. It was just a patch version to update the npm readme. |
Using For those wanting to do this for third party dependencies you can use |
When I use formidable the complier prompt below error. After I removing using of formidable, it will run OK.
/Users/yanglidong/Documents/Work/Company/Git/YLD/samyoc/dist/server/server.js:254224
var crypto = require('crypto');
^
TypeError: require is not a function
at Object.map../file (/Users/yanglidong/Documents/Work/Company/Git/YLD/samyoc/dist/server/server.js:254224:15)
The text was updated successfully, but these errors were encountered: