TypeError: Cannot read properties of undefined (reading 'isDynamic') is suppressing errors in getServerSideProps
See original GitHub issueVerify 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
- TypeError: Cannot read properties of undefined (reading ‘isDynamic’) is obscuring any errors thrown in
getServerSideProps
, and possible anywhere inindex.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:
- Created a year ago
- Comments:8 (2 by maintainers)
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.
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.