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