{"record":{"id":"61450bed75d210bf","repo":"facebook/react","slug":"profiling-data-cannot-be-updated-while-profiling-i","errorCode":null,"errorMessage":"Profiling data cannot be updated while profiling is in progress.","messagePattern":"Profiling data cannot be updated while profiling is in progress\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react-devtools-shared/src/devtools/ProfilerStore.js","lineNumber":162,"sourceCode":"\n  get isProcessingData(): boolean {\n    return this._rendererQueue.size > 0 || this._dataBackends.length > 0;\n  }\n\n  get isProfilingBasedOnUserInput(): boolean {\n    return this._isProfilingBasedOnUserInput;\n  }\n\n  get profilingCache(): ProfilingCache {\n    return this._cache;\n  }\n\n  get profilingData(): ProfilingDataFrontend | null {\n    return this._dataFrontend;\n  }\n  set profilingData(value: ProfilingDataFrontend | null): void {\n    if (this._isBackendProfiling) {\n      console.warn(\n        'Profiling data cannot be updated while profiling is in progress.',\n      );\n      return;\n    }\n\n    this._dataBackends.splice(0);\n    this._dataFrontend = value;\n    this._initialRendererIDs.clear();\n    this._initialSnapshotsByRootID.clear();\n    this._inProgressOperationsByRootID.clear();\n    this._cache.invalidate();\n\n    this.emit('profilingData');\n  }\n\n  clear(): void {\n    this._dataBackends.splice(0);\n    this._dataFrontend = null;","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-devtools-shared/src/devtools/ProfilerStore.js#L144-L180","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["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.","Guard custom code: only assign profilingData when profilerStore.isProfilingBasedOnUserInput is false and isProcessingData is false.","If DevTools auto-started profiling on load, stop it once, then load your saved profile."],"exampleFix":"// before\nprofilerStore.profilingData = importedProfile; // warns and no-ops while recording\n\n// after\nif (profilerStore.isProfilingBasedOnUserInput) {\n  profilerStore.stopProfiling();\n}\nprofilerStore.profilingData = importedProfile;","handlingStrategy":"validation","validationCode":"if (profilerStore.isProfilingBasedOnUserInput) {\n  profilerStore.stopProfiling();\n}\nif (!profilerStore.isProcessingData) {\n  profilerStore.profilingData = importedProfile;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Disable the import/load buttons while isProfiling is true (the built-in UI already does this).","Stop recording and wait for processing to finish before assigning profilingData.","In embedded DevTools, do not auto-load saved profiles when the constructor was started with isProfiling: true."],"tags":["react-devtools","profiler","import-export","state-conflict","dev-only"],"backgroundTag":"invalid-state-transition","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}