-
Notifications
You must be signed in to change notification settings - Fork 48.6k
how to debug Cannot read property '__reactInternal .... of null ? #8091
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
Comments
If you have an error like this, you likely have an earlier error which got React into an inconsistent state. If you use Promises, you might be catching those errors by mistake, and so they never appear in the console. If you think this is a React bug, please provide a fiddle reproducing the issue. |
Closing due to lack of details and no response. |
Can you better define getting react into an inconsistent state? What are common problems that would lead this to happen? |
If React component throws in a render or a lifecycle method, it is likely to get into that state. This will be fixed in future versions (in which we'll support error boundaries). |
A small update on this. We just released React 16 beta which shouldn’t emit cryptic errors like this one. Even if the application code swallows an error, React 16 will still print it to the console. It might be too early for you to try React 16 (since ecosystem is still preparing for it), but this error should never occur in the future after you switch to it. |
I have an example how this error appeared.
Right now we are using 15.5. |
Make sure to call |
In my case was a little mistake, I was doing |
I recently faced this issue within Enzyme. It turns out that you cannot - wrapper.find(Icon).simulate('click');
+ wrapper.find(Icon).find('span').simulate('click'); Hope this helps anyone else lost by the cryptic error message. |
is there any good debugging toool for finding the exact line numbers or Component names where we got the error like
Uncaught TypeError: Cannot read property '__reactInternalInstance$mdm22afavg17ndrawaq8e61or' of null
is only adding console logs for every file is the solution ????????
The text was updated successfully, but these errors were encountered: