-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
(Nextjs) - Sentry - React three fiber bug #13413
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
Comments
I tried to find the "real" reason for the problem, but I couldn't find it (yet) Also, I'm sorry if this is not a Sentry but a https://github.com/pmndrs/react-three-fiber bug, I was not sure this belongs in here I posted it as a Sentry bug, because even though the error seems to get thrown in Fiber https://github.com/pmndrs/react-three-fiber/blob/a457290856f57741bf8beef4f6ff9dbf4879c0a5/packages/fiber/src/core/utils.ts#L337, I have the feeling that Fiber has a problem because maybe Sentry has added some Sentry specific attributes to the canvas element, actually there is an ambientlight three fiber component (inside of the canvas) where sentry seems to have added attributes and this seems to be the initial cause When I remove Sentry from the Next.js configuration then everything is OK (no error in the console) Also this error is only happens, when Next.js runs in "production", in development there is NO error I tried to disable sentry integrations like breadcrumbs dom and also disable replaycanvas but the sentry attributes kept being placed onto fiber components as well as the canvas element itself |
I found another Issue afterall, which seems to be about the problem I describe: getsentry/sentry-javascript-bundler-plugins#530 EDIT: so yes, that Issue sentry-javascript-bundler-plugins #530 is about the same problem, disabling reactComponentAnnotation fixes the react three fiber problem next.config.js: export default withSentryConfig(nextConfig, {
// Automatically annotate React components to show their full name in breadcrumbs and session replay
reactComponentAnnotation: {
enabled: false,
},
}); As suggested in the sentry-javascript-bundler-plugins #530 Issue, a way to exclude some components would be really useful |
Hi, thanks for being patient! Since we have established that this is caused by getsentry/sentry-javascript-bundler-plugins#530 I'll close this issue and we'll track it over there. cc @0Calories |
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
8.26.0
Framework Version
Next 14.2.5
Link to Sentry event
https://chrisweb.sentry.io/issues/5724309981/?project=4507792998465536&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=24h&stream_index=0
Reproduction Example/SDK Setup
https://github.com/chrisweb/bug_repodruction_undefined-_reading_sentry
!!! error happens only in "production" (don't use
npm run dev
):Steps to Reproduce
start nextjs in production (
npm run build
, thennpm run start
)open browser, localhost:3000
page will try to load a react three fiber canvas
error gets triggered
Expected Result
No error in browser console
Actual Result
Error in browser console:
TypeError: Cannot read properties of undefined (reading 'sentry')
at 79-69aeb92584b14fbc.js:1:5614
at Array.reduce ()
at G (79-69aeb92584b14fbc.js:1:5599)
(...)
The text was updated successfully, but these errors were encountered: