-
Notifications
You must be signed in to change notification settings - Fork 987
Closed
Closed
Copy link
Labels
questionUser is asking a question not related to a new feature or bugUser is asking a question not related to a new feature or bug
Description
What happened?
Steps to Reproduce
Running const sdk = new NodeSDK({}); sdk.start(); pops up this WebPack error:
Critical dependency: the request of a dependency is an expression
Expected Result
No error.
Actual Result
Error.
Additional Details
It appears that the error is coming from a dynamic import here:
Line 164 in c84698d
| const version = require(path.join(baseDir, 'package.json')).version; |
It's even shielded by the // eslint-disable-next-line @typescript-eslint/no-var-requires.
This seems like an auxiliary function and perhaps the SDK could allow users to bypass the need to execute this dynamic require?
OpenTelemetry Setup Code
const sdk = new NodeSDK({
resource: new Resource({}),
});
sdk.start();package.json
{
"name": "otel",
"version": "0.3.0",
"private": true,
"type": "module",
"scripts": {
"type-check": "tsc --noEmit"
},
"dependencies": {
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.43.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.43.0",
"@opentelemetry/exporter-trace-otlp-proto": "^0.43.0",
"@opentelemetry/resources": "^1.17.0",
"@opentelemetry/sdk-node": "^0.43.0",
"@opentelemetry/sdk-trace-node": "^1.17.0",
"@opentelemetry/semantic-conventions": "^1.17.0"
},
"devDependencies": {
"@types/node": "18.15.11",
"typescript": "5.1.3"
}
}Relevant log output
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
vercel-site:dev: ../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
vercel-site:dev: ../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
vercel-site:dev: ../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/instrumentation/build/src/index.js
vercel-site:dev: ../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/sdk-node/build/src/sdk.js
vercel-site:dev: ../../node_modules/.pnpm/@[email protected]_@[email protected]/node_modules/@opentelemetry/sdk-node/build/src/index.js
../../packages/otel/src/index.tsriordanpawley, ya2s, mridang and dwjohnston
Metadata
Metadata
Assignees
Labels
questionUser is asking a question not related to a new feature or bugUser is asking a question not related to a new feature or bug