Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
invariant(
          nextEffect !== null,
          'Should have next effect. This error is likely caused by a bug ' +
            'in React. Please file an issue.',
        );
        onCommitPhaseError(nextEffect, error);
        if (nextEffect !== null) {
          nextEffect = nextEffect.nextEffect;
        }
      }
    }
    isCommitting = false;
    isWorking = false;
    stopCommitLifeCyclesTimer();
    stopCommitTimer();
    if (typeof onCommitRoot === 'function') {
      onCommitRoot(finishedWork.stateNode);
    }
    if (__DEV__ && ReactFiberInstrumentation.debugTool) {
      ReactFiberInstrumentation.debugTool.onCommitWork(finishedWork);
    }
    const remainingTime = root.current.expirationTime;
    if (remainingTime === NoWork) {
      
      
      legacyErrorBoundariesThatAlreadyFailed = null;
    }
    return remainingTime;
  }
  function resetExpirationTime(