Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
if (finishedWork.lastEffect !== null) {
        finishedWork.lastEffect.nextEffect = finishedWork;
        firstEffect = finishedWork.firstEffect;
      } else {
        firstEffect = finishedWork;
      }
    } else {
      
      firstEffect = finishedWork.firstEffect;
    }
    prepareForCommit(root.containerInfo);
    
    nextEffect = firstEffect;
    startCommitSnapshotEffectsTimer();
    while (nextEffect !== null) {
      let didError = false;
      let error;
      if (__DEV__) {
        invokeGuardedCallback(null, commitBeforeMutationLifecycles, null);
        if (hasCaughtError()) {
          didError = true;
          error = clearCaughtError();
        }
      } else {
        try {
          commitBeforeMutationLifecycles();
        } catch (e) {
          didError = true;