Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
let completedBatches: Array<Batch> | null = null;
  // Use these to prevent an infinite loop of nested updates
  const NESTED_UPDATE_LIMIT = 1000;
  let nestedUpdateCount: number = 0;
  const timeHeuristicForUnitOfWork = 1;
  function scheduleCallbackWithExpiration(expirationTime) {
    if (callbackExpirationTime !== NoWork) {
      
      if (expirationTime > callbackExpirationTime) {
        
        return;
      } else {
        
        
        cancelDeferredCallback(callbackID);
      }
      // The request callback timer is already running. Don't start a new one.
    } else {
      startRequestCallbackTimer();
    }
    // Compute a timeout for the given expiration time.
    const currentMs = now() - originalStartTimeMs;
    const expirationMs = expirationTimeToMs(expirationTime);
    const timeout = expirationMs - currentMs;
    callbackExpirationTime = expirationTime;
    callbackID = scheduleDeferredCallback(performAsyncWork, {timeout});
  }
  
  
  function requestWork(root: FiberRoot, expirationTime: ExpirationTime) {