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
TypeError: Cannot read property '_documentProps' of null #9647
Comments
It's basically impossible to help you / say what it relates to as no reproduction is provided. |
Are you using Apollo? |
Seem to have fixed this with some refactor to the _document.tsx code :
close to what is in the examples. Running into other issues though updating from 9.0.4 to 9.1.4..This seems to be a non-trivial update for some reason. Thanks for the pointers anyway. I know its difficult to help without some reproduction repo but sometimes issues popup for other reasons and don't show themselves in a hello world scenario. app has of course other code that could dispatch unwanted things..thats ofc always possible. trying to debug and provide as much information as possible always. Thank you for all the help sir. you are awesome 👍 |
I faced the same issue, not sure if this is related. But, the issue was caused due to improper import. Instead of |
@Shub1427 You're a beauty, thanks! |
@Shub1427 ❤️ |
Wow, this saved me after almost 2 days of being stuck. I think this should definitely be better documented. |
This comment has been minimized.
This comment has been minimized.
I am getting this error |
@sibasishm I faced that error & the solution was to do For more info → #16162 But I am getting another error now |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
TypeError: Cannot read property '_documentProps' of null
This gets thrown in the render method of
Head
:Works fine in development but when building and running the build version it crashes
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
I understand this might be something related to my setup. I am using typescript and nextjs.
Expected behavior
No error thrown.
System information
Additional context
App works fine in 9.0.4 but I have a depenency that is throwing a vulnerability warning..and shouldn't be a big update (I assumed).
The issue alwways shows itself in the first element inside the Document in pages/_document. In this case its "Head" but if I remove Head then it shows itself in "Main". Somehow this context is not getting populated..only when building (works in development)
This is the getInitialProps of my _document page :
The text was updated successfully, but these errors were encountered: