Open PrinOrange opened 5 months ago
I'm having the same issue, with Application Insights. This issue was introduced with Next 14.2.X
.
Dependencies
"@microsoft/applicationinsights-react-js": "^17.1.2",
"@microsoft/applicationinsights-web": "^3.1.2",
"applicationinsights": "^3.0.0",
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 18.17.1
npm: 9.6.7
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 14.2.2
eslint-config-next: 14.2.2
react: 18.2.0
react-dom: 18.2.0
typescript: 5.0.4
Next.js Config:
output: standalone
Output on yarn dev
- Local: http://localhost:3000
- Environments: .env.local, .env.development
- Experiments (use with caution):
· instrumentationHook
✓ Starting...
next-type-safe-routes: types written to @types/next-type-safe-routes
next-type-safe-routes: types written to @types/next-type-safe-routes
next-type-safe-routes: types written to @types/next-type-safe-routes
○ Compiling /instrumentation ...
⚠ ./node_modules/@azure/monitor-opentelemetry/dist/index.js
Module not found: Can't resolve '@azure/functions-core' in '[PROJECT_FOLDER]/node_modules/@azure/monitor-opentelemetry/dist'
Import trace for requested module:
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/dist/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js
./node_modules/diagnostic-channel-publishers/dist/src/index.js
./node_modules/applicationinsights/out/src/logs/diagnostic-channel/initialization.js
./node_modules/applicationinsights/out/src/logs/autoCollectLogs.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
Module not found: Can't resolve '@opentelemetry/exporter-jaeger' in '[PROJECT_FOLDER]/node_modules/@opentelemetry/sdk-node/build/src'
Import trace for requested module:
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
./node_modules/@opentelemetry/sdk-node/build/src/sdk.js
./node_modules/@opentelemetry/sdk-node/build/src/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
✓ Ready in 5.4s
⚠ ./node_modules/@azure/monitor-opentelemetry/dist/index.js
Module not found: Can't resolve '@azure/functions-core' in '[PROJECT_FOLDER]/node_modules/@azure/monitor-opentelemetry/dist'
Import trace for requested module:
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/dist/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js
./node_modules/diagnostic-channel-publishers/dist/src/index.js
./node_modules/applicationinsights/out/src/logs/diagnostic-channel/initialization.js
./node_modules/applicationinsights/out/src/logs/autoCollectLogs.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
Module not found: Can't resolve '@opentelemetry/exporter-jaeger' in '[PROJECT_FOLDER]/node_modules/@opentelemetry/sdk-node/build/src'
Import trace for requested module:
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
./node_modules/@opentelemetry/sdk-node/build/src/sdk.js
./node_modules/@opentelemetry/sdk-node/build/src/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
⚠ ./node_modules/@azure/monitor-opentelemetry/dist/index.js
Module not found: Can't resolve '@azure/functions-core' in '[PROJECT_FOLDER]/node_modules/@azure/monitor-opentelemetry/dist'
Import trace for requested module:
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/dist/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js
./node_modules/diagnostic-channel-publishers/dist/src/index.js
./node_modules/applicationinsights/out/src/logs/diagnostic-channel/initialization.js
./node_modules/applicationinsights/out/src/logs/autoCollectLogs.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
Module not found: Can't resolve '@opentelemetry/exporter-jaeger' in '[PROJECT_FOLDER]/node_modules/@opentelemetry/sdk-node/build/src'
Import trace for requested module:
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
./node_modules/@opentelemetry/sdk-node/build/src/sdk.js
./node_modules/@opentelemetry/sdk-node/build/src/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
⚠ ./node_modules/@azure/monitor-opentelemetry/dist/index.js
Module not found: Can't resolve '@azure/functions-core' in '[PROJECT_FOLDER]/node_modules/@azure/monitor-opentelemetry/dist'
Import trace for requested module:
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/@azure/opentelemetry-instrumentation-azure-sdk/dist/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/node/index.js
./node_modules/@opentelemetry/instrumentation/build/src/platform/index.js
./node_modules/@opentelemetry/instrumentation/build/src/index.js
./node_modules/diagnostic-channel-publishers/dist/src/azure-coretracing.pub.js
./node_modules/diagnostic-channel-publishers/dist/src/index.js
./node_modules/applicationinsights/out/src/logs/diagnostic-channel/initialization.js
./node_modules/applicationinsights/out/src/logs/autoCollectLogs.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
Module not found: Can't resolve '@opentelemetry/exporter-jaeger' in '[PROJECT_FOLDER]/node_modules/@opentelemetry/sdk-node/build/src'
Import trace for requested module:
./node_modules/@opentelemetry/sdk-node/build/src/TracerProviderWithEnvExporter.js
./node_modules/@opentelemetry/sdk-node/build/src/sdk.js
./node_modules/@opentelemetry/sdk-node/build/src/index.js
./node_modules/@azure/monitor-opentelemetry/dist/index.js
./node_modules/applicationinsights/out/src/main.js
./node_modules/applicationinsights/out/src/index.js
Experiencing the same issue as @KasperAndersson above.
We have our own module that wraps Open Telemetry, and since 14.2, we've been observing issues that look related to packing @opentelemetry/instrumentation/build/src/platform/node/instrumentation.js
.
Example:
./node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/instrumentation.js
./node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/instrumentation/build/esm/platform/node/index.js
./node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/instrumentation/build/esm/platform/index.js
./node_modules/@opentelemetry/instrumentation-pino/node_modules/@opentelemetry/instrumentation/build/esm/index.js
./node_modules/@opentelemetry/instrumentation-pino/build/src/instrumentation.js
./node_modules/@opentelemetry/instrumentation-pino/build/src/index.js
./node_modules/@opentelemetry/auto-instrumentations-node/build/src/utils.js
./node_modules/@opentelemetry/auto-instrumentations-node/build/src/index.js
./node_modules/@infinitaslearning/observability/dist/observability/configure-observability.js
./node_modules/@infinitaslearning/observability/dist/observability/index.js
Is this an issue with how the open telemetry modules are distributed or with how they're bundled by next? It all worked tickety-boo until 14.2, and it did introduce changes to building.
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
@KasperAndersson did you find any solution or work around? We are experiencing the same issue.
Hi @andrem0 No, I didn't. I'm also following https://github.com/microsoft/ApplicationInsights-node.js/issues/1102 - and we're working on migrating to Sentry.io instead of AI.
I got a simular error.
instrumentation.ts
does not seem to work with @azure/monitor-opentelemetry which I'm trying.
The error is below.
Error [TypeError]: Native module not found: ./edge-runtime-webpack.js
Is there a way to call once at server-side without instrumentation.ts
?
Link to the code that reproduces this issue
https://github.com/PrinOrange/reproduction-app
To Reproduce
First, install a node-binding package, like the
@napi-rs/tar
, which provides the rust bindings and.node
bytecode module.And then enable the next.js instrumentation with the official document
In next.config.js
In instrumentation.ts, import the node-binding module
Then run project in dev, it crashed
Current vs. Expected behavior
It should import the node-bindings module in
instrumentation.ts
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response