question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'return' of null

See original GitHub issue

Running into a strange issue that i cannot reproduce, it happens when running tests in Karma using 16.3.0-alpha.3

image

The issue is here:

https://github.com/facebook/react/blob/208b490ed907346ae3e37159535299899f74312d/packages/react-reconciler/src/ReactFiberScheduler.js#L864-L877

My test is throwing an error because of a missing onChange handler when rendering a checkbox with checked but no handler. What appears to be happening is that nextUnitOfWork is not null and misses the first branch, replayUnitOfWork is run, after which nextUnitOfWork is null and sourceFiber doesn’t exist and so access of return fails.

I’ve tried for a while to reproduce it, the following codesandbox is a simplified version of the code that is throwing, but the error isn’t present there 😕 https://codesandbox.io/s/0332y243zp

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
JeffUbermancommented, Apr 19, 2018

I’ve upgraded to React v16.3.2 and am seeing a similar error:

screen shot 2018-04-19 at 3 02 50 pm

It’s referencing a similar area of the React codebase, without a null check:

screen shot 2018-04-19 at 3 06 20 pm
4reactions
gaearoncommented, Apr 3, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught TypeError: Cannot read property 'value' of null
I'm getting error in this code, I'm trying to do an event where in when the page is load, it will do the...
Read more >
How to deal with TypeError: cannot read properties of null
While coding in Javascript, you must have at least once received a Type Error which has the message “cannot read properties of null”....
Read more >
TypeError: Cannot read property 'value' of Null in JS
To solve the "Cannot read property 'value' of null" error, make sure that the JS script tag is placed at the bottom of...
Read more >
Uncaught TypeError Cannot read property value of null
I have been getting an ERROR in the code as I'm trying to do an event where when the page is loaded, it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found