React Dev Tools – TypeError: Cannot read property 'constructor' of null
See original GitHub issueI just added a conditional return to BitMidi’s Footer
component so it sometimes returns null
.
The React Dev Tools immediately stopped working when I did that, with the following error:
TypeError: Cannot read property 'constructor' of null
at createReactElement (devtools.js:19)
at createReactCompositeComponent (devtools.js:89)
at updateReactComponent (devtools.js:144)
at createReactCompositeComponent (devtools.js:122)
at updateReactComponent (devtools.js:144)
at Object.componentAdded (devtools.js:236)
at Object.preact.options.afterMount (devtools.js:374)
at flushMounts (preact.js:98)
at diff (preact.js:111)
at render (preact.js:370)
The added line is here: https://github.com/feross/bitmidi.com/blob/d1fe2d39f9a99a307a86d38bdfd265510613b00f/src/views/footer.mjs#L13
Removing this line makes the error go away. Disabling React Dev Tools also makes the error go away.
- Preact 8.3.1
- React Dev Tools 3.3.0
I’m sorry that this is not a small test case, but I wanted to check if anyone had any idea what’s going on here first. Is this a known bug?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
React Type error cannot read properties of null even though ...
You are trying to get the state that is defined in the Main component. Move the constructor to the App component.
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >{solved} TypeError: Cannot read property 'firstname' of ...
{solved} TypeError: Cannot read property 'firstname' of undefined. I'm having like no clue whats wrong with the code.. I've checked the Q&A Forum...
Read more >uncaught typeerror: cannot read properties of null ... - You.com
Am getting "TypeError: Cannot read properties of null (reading 'useMemo') error Redux in my react redux application. I made a very simple react...
Read more >How to Avoid the Infamous "Cannot read properties of ... - Bitovi
As a JavaScript developer, I'm sure you've encountered the frustrating runtime TypeError Cannot read properties of undefined .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for not replying – been away from GitHub. Thanks for fixing the issue @marvinhagemeister
@feross Had the same issue when using custom redirect component. Thought that instant redirect might be an issue so pushed it to next frame
componentWillMount() { setTimeout(() => { route(this.props.to, true); }, 0) }
Solved the problem for me. Hope it helps