-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
Running into a strange issue that i cannot reproduce, it happens when running tests in Karma using 16.3.0-alpha.3
The issue is here:
react/packages/react-reconciler/src/ReactFiberScheduler.js
Lines 864 to 877 in 208b490
| if (nextUnitOfWork === null) { | |
| // This is a fatal error. | |
| didFatal = true; | |
| onUncaughtError(thrownValue); | |
| break; | |
| } | |
| if (__DEV__ && replayFailedUnitOfWorkWithInvokeGuardedCallback) { | |
| const failedUnitOfWork = nextUnitOfWork; | |
| replayUnitOfWork(failedUnitOfWork, isAsync); | |
| } | |
| const sourceFiber: Fiber = nextUnitOfWork; | |
| let returnFiber = sourceFiber.return; |
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
