How to use the react-error-overlay.dismissBuildError function in react-error-overlay

To help you get started, we’ve selected a few react-error-overlay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeit / next.js / packages / next / client / dev / error-overlay / hot-dev-client.js View on Github external
async function tryApplyUpdates(onHotUpdateSuccess) {
  if (!module.hot) {
    // HotModuleReplacementPlugin is not in Webpack configuration.
    console.error('HotModuleReplacementPlugin is not in Webpack configuration.')
    // window.location.reload();
    return
  }

  if (!isUpdateAvailable() || !canApplyUpdates()) {
    ErrorOverlay.dismissBuildError()
    return
  }

  function handleApplyUpdates(err, updatedModules) {
    if (err || hadRuntimeError) {
      if (err) {
        console.warn('Error while applying updates, reloading page', err)
      }
      if (hadRuntimeError) {
        console.warn('Had runtime error previously, reloading page')
      }
      window.location.reload()
      return
    }

    if (typeof onHotUpdateSuccess === 'function') {
github lnlfps / symph-joy / client / dev-error-overlay / hot-dev-client.js View on Github external
tryApplyUpdates(function onHotUpdateSuccess () {
      // Only dismiss it when we're sure it's a hot update.
      // Otherwise it would flicker right before the reload.
      ErrorOverlay.dismissBuildError()
    })
  }
github halfzebra / create-elm-app / scripts / utils / webpackHotDevClient.js View on Github external
tryApplyUpdates(function onSuccessfulHotUpdate() {
      // Only print warnings if we aren't refreshing the page.
      // Otherwise they'll disappear right away anyway.
      printWarnings();
      // Only dismiss it when we're sure it's a hot update.
      // Otherwise it would flicker right before the reload.
      ErrorOverlay.dismissBuildError();
    });
  } else {
github zeit / next.js / packages / next / client / dev / error-overlay / hot-dev-client.js View on Github external
tryApplyUpdates(function onHotUpdateSuccess() {
      if (deferredBuildError) {
        deferredBuildError()
      } else {
        // Only dismiss it when we're sure it's a hot update.
        // Otherwise it would flicker right before the reload.
        ErrorOverlay.dismissBuildError()
      }
    })
  }
github facebook / create-react-app / packages / react-dev-utils / webpackHotDevClient.js View on Github external
function tryDismissErrorOverlay() {
  if (!hasCompileErrors) {
    ErrorOverlay.dismissBuildError();
  }
}
github codejamninja / reactant / packages / web / src / hotDevClient.js View on Github external
function clearErrors() {
  if (module.hot.status() === 'fail') {
    windowReload();
  } else if (hadError) {
    hadError = false;
    consoleClear();
    dismissBuildError();
  }
}
github codejamninja / reactant / packages / web / src / hotDevClient.js View on Github external
if (index < formatted.warnings.length) {
        if (index === 5) {
          log.warn(
            'There were more warnings in other files.\n' +
              'You can find a complete log in the terminal.'
          );
        }
        log.warn(stripAnsi(warning));
      }
    });
  }
  printWarnings();
  try {
    if (isHotUpdate) {
      await applyUpdates();
      dismissBuildError();
    }
  } catch (err) {
    reportBuildError(err.stack);
    log.error(err);
    hadError = true;
  }
  isFirstCompilation = false;
}
github trustworktech / create-react-ssr-app / packages / react-ssr-dev-utils / webpackHotDevClient.js View on Github external
function tryDismissErrorOverlay() {
  if (!hasCompileErrors) {
    ErrorOverlay.dismissBuildError();
  }
}