{"record":{"id":"15bdc0356af5ea2f","repo":"GoogleChrome/lighthouse","slug":"no-tti-cpu-idle-period","errorCode":"NO_TTI_CPU_IDLE_PERIOD","errorMessage":"Your page took too long to load. Please follow the opportunities in the report to reduce your page load time, and then try re-running Lighthouse. ({errorCode})","messagePattern":"Your page took too long to load\\. Please follow the opportunities in the report to reduce your page load time, and then try re-running Lighthouse\\. \\((.+?)\\)","errorType":"exception","errorClass":"LighthouseError","httpStatus":null,"severity":"error","filePath":"core/computed/metrics/interactive.js","lineNumber":134,"sourceCode":"        } else {\n          networkCandidate = networkQueue.shift();\n        }\n      } else {\n        // Network starts later than CPU, window must be contained by CPU or we check the next\n        if (cpuCandidate.end >= networkCandidate.start + REQUIRED_QUIET_WINDOW) {\n          return {\n            cpuQuietPeriod: cpuCandidate,\n            networkQuietPeriod: networkCandidate,\n            cpuQuietPeriods,\n            networkQuietPeriods,\n          };\n        } else {\n          cpuCandidate = cpuQueue.shift();\n        }\n      }\n    }\n\n    throw new LighthouseError(\n      cpuCandidate\n        ? LighthouseError.errors.NO_TTI_NETWORK_IDLE_PERIOD\n        : LighthouseError.errors.NO_TTI_CPU_IDLE_PERIOD\n    );\n  }\n\n  /**\n   * @param {LH.Artifacts.NavigationMetricComputationData} data\n   * @param {LH.Artifacts.ComputedContext} context\n   * @return {Promise<LH.Artifacts.LanternMetric>}\n   */\n  static computeSimulatedMetric(data, context) {\n    const metricData = NavigationMetric.getMetricComputationInput(data);\n    return LanternInteractive.request(metricData, context);\n  }\n\n  /**\n   * @param {LH.Artifacts.NavigationMetricComputationData} data","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/computed/metrics/interactive.js#L116-L152","documentation":"Thrown as a LighthouseError with code NO_TTI_CPU_IDLE_PERIOD when findOverlappingQuietPeriods() cannot find any 5-second window where the main thread has no task longer than 50ms (a CPU quiet period). This fires when cpuCandidate is falsy after the search loop, meaning the main thread never stopped being busy for long enough to declare interactivity. Time to Interactive cannot be computed without a CPU quiet period.","triggerScenarios":"The Interactive metric loops through long tasks (>= 50ms). If long tasks are so frequent that no 5-second gap exists between them, no CPU quiet period is ever found, and the throw uses NO_TTI_CPU_IDLE_PERIOD (the ternary in the throw selects this code when cpuCandidate is falsy).","commonSituations":"Pages with heavy JavaScript execution, infinite animation loops, requestAnimationFrame storms, or continuous timer-based work (setInterval). Common on SPAs with heavy re-renders or pages with poorly optimized third-party scripts that constantly execute on the main thread.","solutions":["Break up long JavaScript tasks into smaller chunks using setTimeout, requestIdleCallback, or scheduler.yield()","Move heavy computation to a Web Worker to free the main thread","Eliminate unnecessary setInterval/setTimeout loops or throttle them","Audit and reduce third-party scripts that run continuously on the main thread"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const tti = await Interactive.request(metricData, context);\n} catch (e) {\n  if (e instanceof LighthouseError && e.code === 'NO_TTI_CPU_IDLE_PERIOD') {\n    // Main thread never quiet for 5s — report TTI as N/A\n    return { notApplicable: true, reason: 'NO_TTI_CPU_IDLE_PERIOD' };\n  }\n  throw e;\n}","preventionTips":["Break up long JavaScript tasks to create main-thread quiet windows","Move heavy computation to Web Workers","Reduce or eliminate continuous setInterval/requestAnimationFrame loops","Audit third-party scripts for main-thread thrashing"],"tags":["tti","cpu","performance","metrics","javascript"],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}