Closed eprince1 closed 2 years ago
Hey! Could this be with Node v13?
Then again, Node v13 seems to work on Travis CI (https://travis-ci.org/moll/node-mitm/jobs/604611743)...
updated my node to v13. Still having the issue tho...
react-dom.development.js:25810 ./node_modules/mitm/index.js
Module not found: Can't resolve '_http_server' in 'C:\Users\eitan\Documents\Github\pokemon\node_modules\mitm'
have the same error for
_http_incoming
and _http_common
I'm seeing "React-DOM development" above in your stack trace. How are you running Node? React is a front-end library, but Mitm.js is only for the Node backend...
Did you solve the problem? What was the cause?
@moll we are trying to use failure-lambda which depends on mitm, and we are getting the same error reported here.
ERROR in ./node_modules/mitm/index.js 37:24-65 Module not found: Error: Can't resolve '_http_incoming' in '...node_modules/mitm'
ERROR in ./node_modules/mitm/index.js 38:23-61 Module not found: Error: Can't resolve '_http_server' in '...node_modules/mitm'
ERROR in ./node_modules/mitm/index.js 39:27-67 Module not found: Error: Can't resolve '_http_common' in '...node_modules/mitm'
Hey,
What Node.js version is this with and if you run node
directly and try to require
the _http_common
module, does that work?
@moll, following several GitHub threads related to errors with importing these requirements in other projects the culprit seems to be with webpack, which we are using to bundle code for our AWS Lambda functions (that now include failure-lambda... mitm as a dependency).
Using webpack.config.js and specifying external dependencies to include ['_http_common', '_http_incoming', '_http_server'] seems to resolve our problem with building the lambda functions.
https://www.npmjs.com/package/webpack-node-externals
I will report back if this succeeds.
Good to know. Thanks for sharing. I'll close the issue for now, but do report back once you've solved it for good!
The package fails to load and throws 'Module not found: Can't resolve '_http_server' in 'C:\Users\eitan\Documents\Github\my-app\node_modules\packagetest\node_modules\mitm'.
Not really sure whats going on.