-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
Sideloading OpenTelemetry in Node.js breaks Next.js #21861
Comments
Feel free to send a PR to upgrade. |
We had a similar issue to this with the latest code (10.1.1), but it appears that opentelemetry isn't actually required anymore (removed in #22713), but the opentelemetry/api dependency is still there. I've raised PR #25900 to remove it, so please let me know if that's appropriate to remove and there's not some other reason it's included. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.6
What version of Node.js are you using?
14.15.1
What browser are you using?
Chrome, Firefox
What operating system are you using?
Windows
How are you deploying your application?
node --trace-deprecation -r ./telemetry.js node_modules/next/dist/bin/next dev
Describe the Bug
Running OpenTelemetry in another node module alongside next.js seems to break telemetry in next.js, as it currently relies on an outdated version of opentelemetry, causing import conflicts as the side-loaded module has already imported a newer version of opentelemetry that next.js doesn't support.
Next.js fails with:
Expected Behavior
Next.js to run, even with version conflicts with telemetry disabled through
npx next telemetry disable
One solution would be to update opentelemetry to the newest version. The better solution would be exclude any references to opentelemetry when telemetry is disabled.
To Reproduce
In windows, to create a minimally failing project:
npx create-next-app nextjs-opentelemetry-issue --use-yarn
cd nextjs-opentelemetry-issue
npx next telemetry disable
yarn add @opentelemetry/node @opentelemetry/plugin-https
notepad telemetry.js
add and save:run the project with telemetry.js sideloaded:
node --trace-deprecation -r ./telemetry.js node_modules/next/dist/bin/next dev
The text was updated successfully, but these errors were encountered: