facebook/react · warning

Profiling data cannot be updated while profiling is in progr

Error message

Profiling data cannot be updated while profiling is in progress.

What it means

The ProfilerStore.profilingData setter (packages/react-devtools-shared/src/devtools/ProfilerStore.js:160) replaces in-memory profiling data (e.g. when importing a saved profile). It refuses to do so while this._isBackendProfiling is true, i.e. while the renderer is actively recording a session, because loading a profile mid-recording would corrupt the in-progress data pipeline. The assignment is skipped with this warning; the existing recording is not affected.

Source

Thrown at packages/react-devtools-shared/src/devtools/ProfilerStore.js:162

  get isProcessingData(): boolean {
    return this._rendererQueue.size > 0 || this._dataBackends.length > 0;
  }

  get isProfilingBasedOnUserInput(): boolean {
    return this._isProfilingBasedOnUserInput;
  }

  get profilingCache(): ProfilingCache {
    return this._cache;
  }

  get profilingData(): ProfilingDataFrontend | null {
    return this._dataFrontend;
  }
  set profilingData(value: ProfilingDataFrontend | null): void {
    if (this._isBackendProfiling) {
      console.warn(
        'Profiling data cannot be updated while profiling is in progress.',
      );
      return;
    }

    this._dataBackends.splice(0);
    this._dataFrontend = value;
    this._initialRendererIDs.clear();
    this._initialSnapshotsByRootID.clear();
    this._inProgressOperationsByRootID.clear();
    this._cache.invalidate();

    this.emit('profilingData');
  }

  clear(): void {
    this._dataBackends.splice(0);
    this._dataFrontend = null;

View on GitHub (pinned to eafeac097b)

Solutions

  1. Stop the current session first (click the record/Stop button, i.e. profilerStore.stopProfiling()) and wait for it to finish, then import/assign the profile data.
  2. Guard custom code: only assign profilingData when profilerStore.isProfilingBasedOnUserInput is false and isProcessingData is false.
  3. If DevTools auto-started profiling on load, stop it once, then load your saved profile.

Example fix

// before
profilerStore.profilingData = importedProfile; // warns and no-ops while recording

// after
if (profilerStore.isProfilingBasedOnUserInput) {
  profilerStore.stopProfiling();
}
profilerStore.profilingData = importedProfile;
Defensive patterns

Strategy: validation

Validate before calling

if (profilerStore.isProfilingBasedOnUserInput) {
  profilerStore.stopProfiling();
}
if (!profilerStore.isProcessingData) {
  profilerStore.profilingData = importedProfile;
}

Prevention

When it happens

Trigger: Assigning profilerStore.profilingData (programmatically or via UI code) while a profiling session is active — e.g. importing a .json profile while the record toggle is on, or auto-restoring a profile on DevTools open when profiling was already started (isProfiling config).

Common situations: DevTools extension restored with profiling already in progress (constructor defaultIsProfiling) and then an import/load of profile data happens; custom DevTools embeds that load saved profiles on startup; racing the record button with the import button.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of facebook/react@eafeac097b (2026-08-21). Data as JSON: /api/errors/61450bed75d210bf. Report an issue: GitHub.