-
Notifications
You must be signed in to change notification settings - Fork 546
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
Node v14.17.6 causing the node:crypto module not found issue #2357
Comments
Does anyone know about this?? |
The quickest workaround here assuming you aren't on GCP is to install the instrumentations and detectors you need manually without using the auto-instrumentations-node package. That package adds a lot of things and dependencies and it looks like we may not have control over this. |
One other thing you can try is to update to at least |
I'll try to track down the dep update that resulted in this. I'm guessing it is a transitive dep, so pinning is hard. |
I wonder if this could have been from googleapis/gaxios#638 @architgarg95 Could you please show the output of |
Actually, it looks like there has not been a new gaxios@6 release since it moved back to using uuid@9. |
I knew this was familiar, I reported this earlier: googleapis/gaxios#637 |
Its from gaxios, it has code for require('node:crypto') which is causing this issue |
@architgarg95 Yes, I know it is from gaxios. Could you please show the output of |
npm ls gaxios output: npm ls uuid output: |
@trentm Do you know anything about this?? |
@architgarg95 Thanks for the 'npm ls ...' output. So, yes, you have hit the issue with Other options:
|
There is now a gaxios@6.7.1 release with a fix. If I now install the auto-instrumentations-node package, the resulting install has gaxios@6.7.1 and uuid@9, which should now work with Node.js 14:
|
What version of OpenTelemetry are you using?
0.52.0
What version of Node are you using?
v14.17.6
What did you do?
implemented simple telemetry
What did you expect to see?
telemetry starting correctly and exporting data correctly
What did you see instead?
application fails to run becuase of node:crypto module not found
Additional context
This issue occurs only with the node v14.17.6 or prior version, somehow getting the error node:crypto module not found which in the call stack shows is required by gcp-detector, this gcp-detector internally uses the gaxios which is further dependent on 'node:crypto' module
Error stack below:
Error: Cannot find module 'node:crypto'
[0] Require stack:
[0] - .../src/main/node/node_modules/gaxios/node_modules/uuid/dist/rng.js
[0] - .../src/main/node/node_modules/gaxios/node_modules/uuid/dist/v1.js
[0] - .../src/main/node/node_modules/gaxios/node_modules/uuid/dist/index.js
[0] - .../src/main/node/node_modules/gaxios/build/src/gaxios.js
[0] - .../src/main/node/node_modules/gaxios/build/src/index.js
[0] - .../src/main/node/node_modules/gcp-metadata/build/src/index.js
[0] - .../src/main/node/node_modules/@opentelemetry/resource-detector-gcp/build/src/detectors/GcpDetector.js
[0] - .../src/main/node/node_modules/@opentelemetry/resource-detector-gcp/build/src/detectors/index.js
[0] - .../src/main/node/node_modules/@opentelemetry/resource-detector-gcp/build/src/index.js
[0] - .../src/main/node/node_modules/@opentelemetry/auto-instrumentations-node/build/src/utils.js
[0] - .../src/main/node/node_modules/@opentelemetry/auto-instrumentations-node/build/src/index.js
The text was updated successfully, but these errors were encountered: