question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read properties of undefined (reading '_sentryTransaction')

See original GitHub issue

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.14.0

Framework Version

12.3.0

Link to Sentry event

https://sentry.io/organizations/craft-codery/issues/3635175907/?project=4503904394412032&query=is%3Aunresolved

Steps to Reproduce

  1. Installed Sentry for Next.JS using the instructions at https://docs.sentry.io/platforms/javascript/guides/nextjs/
  2. Used the setup wizard, as per instructions
  3. Wrapped my API routes, as per instructions
  4. Ran my app, visited the homepage, immediately get the error TypeError: Cannot read properties of undefined (reading '_sentryTransaction')

Expected Result

No error

Actual Result

Uncaught TypeError: Cannot read properties of undefined (reading '_sentryTransaction')
  at getTransactionFromRequest(node_modules/@sentry/nextjs/cjs/config/wrappers/wrapperUtils.js:17:14)
  at <unknown>(node_modules/@sentry/nextjs/cjs/config/wrappers/wrapperUtils.js:67:30)
  at bound(node:domain:421:15)
  at runBound(node:domain:432:12)
  at Object.callTracedServerSideDataFetcher(node_modules/@sentry/nextjs/cjs/config/wrappers/wrapperUtils.js:128:5)
  at Function.getInitialProps(node_modules/@sentry/nextjs/cjs/config/wrappers/withSentryServerSideDocumentGetInitialProps.js:33:27)
  at Object.<anonymous>(node_modules/next/dist/shared/lib/utils.js:75:33)
  at Generator.next(<anonymous>)
  at asyncGeneratorStep(node_modules/@swc/helpers/lib/_async_to_generator.js:23:28)
  at _next(node_modules/@swc/helpers/lib/_async_to_generator.js:12:17)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lforstcommented, Oct 3, 2022

We released a patch that should fix this error. Let me know if you encounter any more problems!

1reaction
lforstcommented, Oct 1, 2022

Hi everybody. Thanks for reporting this issue! This bug is caused by a pretty new feature we only roll out per default when installing the SDK via the @sentry/wizard.

In the meanwhile and to get your apps working again you can simply set the autoInstrumentServerFunctions option to false in your Next.js config.

We’ll try to get a fix out for this asap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Sentry TypeError: Cannot read properties of ...
The actual error without the ErrorBoundry component should be TypeError: Cannot read properties of undefined (reading '0').
Read more >
Resolving TypeError: Cannot Read Property of Undefined ...
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
cannot read properties of undefined (reading 'includes'
Here's an example of a JavaScript TypeError: Cannot read property of undefined thrown when a property is attempted to be read on an...
Read more >
Cannot read property 'type' of undefined
Hi, I've just added Sentry to one of our apps and we're getting a lot of these errors: Cannot read property 'type' of...
Read more >
{solved} TypeError: Cannot read property 'firstname' of ...
{solved} TypeError: Cannot read property 'firstname' of undefined. I'm having like no clue whats wrong with the code.. I've checked the Q&A Forum...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found