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 'isDynamic') is suppressing errors in getServerSideProps

See original GitHub issue

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

I’m really at a loss for what causes this bug or how exactly to replicate it (which is one of the issues with the bug), but there’s a bit of discussion about it here: https://github.com/vercel/next.js/discussions/40373

The summary is that in certain cases NextJS will throw an error with the message TypeError: Cannot read properties of undefined (reading 'isDynamic'). I believe this happens when an error is throw in getServerSideProps, or possible anywhere in index.tsx, but I’m not sure. The problem is that the isDynamic error obscures the error that is actually being thrown, making debugging a matter of trial and error.

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

  1. TypeError: Cannot read properties of undefined (reading ‘isDynamic’) is obscuring any errors thrown in getServerSideProps, and possible anywhere in index.tsx.

Expected Behavior

Any errors throw in getServerSideProps should report the actual error being throw, rather than the isDynamic error.

Link to reproduction

N/A

To Reproduce

I honestly I have no idea how to reproduce this consistently.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
amaschascommented, Oct 19, 2022

OK, I actually think we can close this entirely. Our dd-trace plugin was severely out of date. Updating it to the latest addressed the issue.

0reactions
github-actions[bot]commented, Nov 19, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

getServerSideProps is undefined in nextjs - Stack Overflow
Error is on the line post.map() in Home function. Error: "TypeError: Cannot read properties of undefined (reading 'map')" import Header ...
Read more >
typeerror: cannot read properties of undefined ... - You.com
TypeError : Cannot read properties of undefined (reading 'isDynamic') is obscuring any errors thrown in getServerSideProps , and possible anywhere in index.tsx ....
Read more >
Data Fetching: getServerSideProps - Next.js
When exporting a function called getServerSideProps (Server-Side Rendering) from a page, Next.js will pre-render this page on each request using the data ...
Read more >
Data Fetching: getStaticProps - Next.js
You can also set basePath: false similar to redirects in next.config.js . export async function getStaticProps(context) { ...
Read more >
Ignoring TypeScript Errors - next.config.js
Next.js reports TypeScript errors by default. Learn to opt-out of this behavior here.
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