desktop / desktop

Focus on what matters instead of fighting with Git.
https://desktop.github.com
MIT License
19.66k stars 9.39k forks source link

TypeError: Cannot read property '__reactInternalInstance$jhcl9oakqvvlttco8ywuerk9' of null #1558

Closed joshaber closed 7 years ago

joshaber commented 7 years ago

https://haystack.githubapp.com/desktop/needles/Zqxd13opJM0IgBulUnNCLQ

TypeError: Cannot read property '__reactInternalInstance$jhcl9oakqvvlttco8ywuerk9' of null
at Object.V [as getClosestInstanceFromNode] (file:///app/renderer.js:1:15371)
at L (file:///app/renderer.js:3:134325)
at z (file:///app/renderer.js:3:134547)
at L.perform (file:///app/renderer.js:1:88741)
at Object.batchedUpdates (file:///app/renderer.js:3:132824)
at Object.batchedUpdates (file:///app/renderer.js:1:37864)
at dispatchEvent (file:///app/renderer.js:3:135534)
shiftkey commented 7 years ago

__reactInternalInstance$jhcl9oakqvvlttco8ywuerk9'

joshaber commented 7 years ago

My current theory is this is related to https://github.com/desktop/desktop/issues/1507, where we'd throw an exception while the component was mounting. It wouldn't be too surprising if React was broken after that.

So I'm gonna close this 🙏 and we can re-open if it's still happening on 0.5.4.

cancerberoSgx commented 5 years ago

Make sure to call wrapper.update() before the method is throwing the error (like wrapper.simulate()). I think that of error is thrown (enzyme) when the wrapper points to nodes that no longer exists (because the page was re-rendered or the original nodes replaced/changed for some reason ). update() solved the problem in my case ( error thrown when calling wrapper.simulate() - working with enzyme / jsdom)

shiftkey commented 5 years ago

@cancerberoSgx thanks for the suggestion - however we're not using Enzyme in the project so this likely isn't a factor. I haven't heard any recent incidents of this but we'll keep an eye on things just in case.