-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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.js Class extends value undefined is not a constructor or null on v7.89.0 #10366
Comments
The same problem. I spent a few hours, and I didn't understand what happened. @sentry/[email protected] My first app uses Static Side Rendering ( In the error log I see the reference to the
|
Hi, which Next.js version are you on? |
Also, would anybody be able to share a minimal reproduction example that runs into this? Thank you! |
I'm on next js 14.1 and I have the same error when I perform a server action. It does seem to me Next using the cjs version of @sentry/react is the cause of the error as I find the following in the log
|
Hm, @alvis would you be able to provide a small reproduction repository? |
@cpotey My company is experiencing the same issue but using a simplified version of the code you provided in a simple repro project doesn't cause it, so I think there might be more to cause it to occur. Not sure exactly what the offending pattern is in our codebase. |
I'm experiencing this error as well. It happens in Next.js 14, only in dev mode, when some server action is triggered. |
I have upgraded my project deps to the latest versions, and this problem has been resolved.
|
@DenisBessa would you mind giving a few more details? We have E2E tests covering server actions and they are not running into this. |
I just realized the severity of this. Sorry for the inconvenience. I originally underestimated the impact. We will fix this asap. |
Alternatively, I figured out the configuration below saves my days too. Seems like by forcing next to analyze barrel files, it ignores a problematic file down the route. @lforst hope it may help {
experimental: {
optimizePackageImports: [
'@sentry/core',
'@sentry/nextjs',
'@sentry/react'
]
}
} |
Hi everybody, we just released version |
Thanks @lforst, Can confirm Also, do you happen to know if it's a good idea to just leave Next.js team seems to have removed it to avoid a 350ms delay on cold boot, but I'm not sure if this is worth having the package broken again in the future. |
@avarayr Thank you very much for confirming! I highly recommend not putting It is really important for us moving forward because this was necessary for us to have directives like |
I can confirm this workaround fixed it. I almost stopped reading at this point but decided to check the latest comments and saw that the correct fix is actually:
@lforst Thanks to the Sentry team for fixing this. |
@nbolton right. Thanks for the heads up! @meienberger Thanks again for providing the workaround. I edited your comment to point people towards upgrading the SDK. I hope that's ok! |
I'm using |
@RisingGeek if you can attribute this to the SDK and if you could provide a reproduction example that would be amazing. (if so, please do it in a new isse) Thanks! |
I think we need a reproduction example we can check out locally to properly troubleshoot this. |
Nevermin, this was an environment issue, I had |
This also fixed the below error I encountered.
|
We are also getting this error after adding the "--turbo" command to our dev builds. "@sentry/nextjs": "8.28.0",
"next": "14.2.7" When we spin up the local dev server we get the same error:
Hope this helps in any way. |
I got this error when I added an error boundary to a server component. The package I'm using must be a client component. |
Same here. I got this error when I used <Sentry.ErrorBoundary> and did not annotate my file with |
Reopening. It seems like we should add a |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
7.89.0
Framework Version
7.89.0
Link to Sentry event
https://the-key.sentry.io/issues/4917806857/?project=4506501905252352&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=14d&stream_index=0
SDK Setup
Steps to Reproduce
In my Next v14.1.0 app, I loaded a page, when a component seems to change inside the page, it caused an error from Sentry:
I have worked out the code that is the problem is within a server-only function which is loaded on every page to fetch user data from my API, this function is also where I am setting the user for Sentry.
If I comment the Sentry parts out, everything works as expected.
This error doesn't occur on
v7.88.0
of@sentry/nextjs
, so am stuck on this version for now. I use this function in several places within my monorepo, so am unable to upgrade Sentry until I can find a solution here.Expected Result
No errors in the console to occur
Actual Result
The text was updated successfully, but these errors were encountered: