Guides

Crash Isolation & Safe Mode

Advanced~6 min

Understand how module failures are isolated and how the runtime exposes safe mode controls.

Prerequisites

  • A module with code paths that can fail during boot or rendering.
  • Access to WP-CLI for runtime diagnostics.
  • Willingness to isolate risky UI into bounded widgets.

What You Will Finish With

  • Understand where the runtime contains PHP-side module failures.
  • Use safe mode commands to recover a broken install.
  • Wrap risky React widgets in ErrorBoundary instead of crashing the whole page.

Module boot isolation

Modules boot after the runtime builds SdkContext. The loader isolates failures so a broken module does not take down the rest of wp-admin.

Safe mode controls

The runtime exposes top-level WP-CLI commands to inspect and control safe mode state.

wp meteorack status
wp meteorack safe-mode status
wp meteorack safe-mode enable
wp meteorack safe-mode disable

React-side isolation

Wrap risky widgets in ErrorBoundary so a broken section falls back locally instead of crashing the entire page.

import { ErrorBoundary, Card } from '@meteorack/modules-sdk-ui';

function RiskyWidget() {
  throw new Error('Malformed payload');
}

export function SafeWidget() {
  return (
    <ErrorBoundary fallback={<Card>Widget failed to render.</Card>}>
      <RiskyWidget />
    </ErrorBoundary>
  );
}