-
Notifications
You must be signed in to change notification settings - Fork 27k
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
[NEXT-1100] unhandledRejection: Error [TypeError]: trace.getSpan is not a function #48118
Comments
This also worked for me to resolve this issue as per #46632 / yarn add @opentelemetry/api @opentelemetry/resources @opentelemetry/semantic-conventions @opentelemetry/sdk-trace-node @opentelemetry/instrumentation But, it seems very odd to me that I would need to do this. Please let me know if a better solution appears. |
I am running into this problem when upgrading my next-apps from 12 to 13. It only happens in production. In development mode, everything works perfectly. |
Trying to upgrade to the latest 13.4 and getting this error. Any response from the next team? Seems odd that consumers would need to install opentelemetry themselves 🤔 |
It appears that |
@jamesopti There's a built-in version of opentelementry by default, it should work even you didn't install it. I can't repro the error with latest version 13.4.1 with origin reproduction post in the issue description. Could you post another reproduction for this if you're still seeing the error? |
We're using a monorepo where the client package is nextjs. Our server package requires @opentelemetry/api. Is it possible this is causing a conflict? Additionally, why is
|
FWIW, this issue was introduced in 13.4.0
EDIT: 13.1 does not have this issue, but 13.3.4 does |
The different version could be possible reason, could you try add |
@huozhi Can you elaborate more? I'm not familiar with yarn resolutions. I added this to our workspace root package.json but same issue happens when I run
|
@jamesopti yes ideally only "resolutions": {
"**/@opentelemetry/api": "0.18.1",
} |
@huozhi Tried that and still same error (also upgraded to latest 13.4.3 which fixes the dev server react issue). Any other ideas? |
@jamesopti We really need a minimal reproduction here as the original reproduction in the issue is not able to repro the issue. Please provide a reproduction repo |
We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate. Why was this issue marked with the
|
I can no longer reproduce the issue, so if someone else can, please provide a minimal reproduction. Thanks! |
@dossy @huozhi This is very easy to reproduce with a super simple yarn workspaces monorepo. Check this one out here: https://github.com/jamesopti/next-tracespan-error-reproduction The The |
Any updates here? This has been a blocker for us upgrading for over a month now (stuck on 13.1) |
Hey! I took a look and it appears that you're on Confirmed that your repo works fine if upgrading the |
So now I'm really confused. Is The solution to run my client can't just be to upgrade the entire telemetry package for my server.
According to this comment, I was under the impression that consumers were not required to install opentelementry themselves |
@jamesopti I did a quick look and The logic in Next.js is that if you have opentelementry installed, Next.js will use your version. Otherwise Next.js uses its built-in one. But here the problem is that the user provided version doesn't meet the need. |
So it sounds like I need a way to tell Yarn workspaces that the In classic yarn you could use the noHoist option but with Yarn 3 I'm not sure how to do that anymore. I'll also explore the 0.19.0 approach, which is much more doable than a major version upgrade. Thanks for the detail |
Unfortunately I'm going to capitulate and just install the latest @opentelemetry packages in my nextjs workspace. |
Why do you use a two year old experimental version of @dyladan Wasn't the idea that you could use different versions of the API-package without issues in one project? |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
Link to the code that reproduces this issue
https://github.com/dossy/nextjs-trace-getSpan-is-not-a-function
To Reproduce
Provided by #48118 (comment)
reproduce with a yarn workspaces monorepo.
Check this one out here: jamesopti/next-tracespan-error-reproduction
The packages/server has "@opentelemetry/api": "^0.18.1"
The packages/client is a brand new create next app.
Describe the Bug
Trying to access the app results in an
unhandledRejection: Error [TypeError]: trace.getSpan is not a function
error:Expected Behavior
The home page should render in the browser.
Which browser are you using? (if relevant)
Chrome Version 111.0.5563.146 (Official Build) (x86_64)
How are you deploying your application? (if relevant)
locally
From SyncLinear.com | NEXT-1100
The text was updated successfully, but these errors were encountered: