Cannot set properties of undefined (setting '_sentryTraceData')
See original GitHub issueIs there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
SDK Version
7.14.2
Framework Version
React 18.1.0
Link to Sentry event
No response
Steps to Reproduce
Hello, Thank you for quickly addressing issue #5877 . I saw that issue was fixed in 7.14.2 and tried it today.
Build was successful, but a runtime error occurred.
TypeError: Cannot set properties of undefined (setting '_sentryTraceData')
at Function.getInitialProps (/app/node_modules/@sentry/nextjs/cjs/config/wrappers/withSentryServerSideAppGetInitialProps.js:44:55)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.loadGetInitialProps (/app/node_modules/next/dist/shared/lib/utils.js:70:19)
at async Object.renderToHTML (/app/node_modules/next/dist/server/render.js:436:14)
at async doRender (/app/node_modules/next/dist/server/base-server.js:917:38)
at async cacheEntry.responseCache.get.isManualRevalidate.isManualRevalidate (/app/node_modules/next/dist/server/base-server.js:1022:28)
at async /app/node_modules/next/dist/server/response-cache.js:69:36
TypeError: Cannot set properties of undefined (setting '_sentryTraceData')
I am using next.js v12.2 - using SSR(ISR)
next.config.js
sentry: {
hideSourceMaps: true,
autoInstrumentServerFunctions: true,
},
Expected Result
The application builds normally.
Actual Result
Internal Server Error
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TypeError: Cannot set properties of undefined (setting 'duration')
What is happening is that you are trying to access an item in the list using the index listOfSelectedQuestions[index] but the item doesn't ......
Read more >Cannot set properties of undefined (setting '_sentryTraceData')
Build was successful, but a runtime error occurred. TypeError: Cannot set properties of undefined (setting '_sentryTraceData') at Function.
Read more >vite: TypeError: Cannot set properties of undefined (setting 'j ...
... project template? when i run the example json_schema_validation.svelte, i get the error. Uncaught SyntaxError: The requested module '/node_modules/.pnpm/ ...
Read more >Cannot set properties of undefined Ammo - Bugs - Babylon.js
Hello everyone! So im having a bug where i installed the AmmoJS but when i use it its not working i dont really...
Read more >TypeError: Cannot set properties of Undefined in JavaScript
The "Cannot set properties of undefined" error occurs when setting a property on an `undefined` value. To solve the error conditionally check if...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ccj9707
I feel like this one (for a change 😄) isn’t on us.
The Next.js docs on custom apps state that if you have a
getInitialProps
in your_app.js
, you must callApp.getInitialProps(appContext)
and merge its return values with your initial props.Here’s the code example from the docs:
@lforst Problem solved! Thanks, I’ve corrected the weird stuff.