{"record":{"id":"f525520f699ed719","repo":"microsoft/playwright","slug":"cannot-clear-timer-timer-created-with-schedule","errorCode":null,"errorMessage":"Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()","messagePattern":"Cannot clear timer: timer created with (.+?)\\(\\) but cleared with (.+?)\\(\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/injected/src/clock.ts","lineNumber":432,"sourceCode":"    const id = Number(timerId);\n\n    if (Number.isNaN(id) || id < idCounterStart) {\n      const handlerName = getClearHandler(type);\n      new Error(`Clock: ${handlerName} was invoked to clear a native timer instead of one created by the clock library.`);\n    }\n\n    const timer = this._timers.get(id);\n    if (timer) {\n      if (\n        timer.type === type ||\n        (timer.type === 'Timeout' && type === 'Interval') ||\n        (timer.type === 'Interval' && type === 'Timeout')\n      ) {\n        this._timers.delete(id);\n      } else {\n        const clear = getClearHandler(type);\n        const schedule = getScheduleHandler(timer.type);\n        throw new Error(\n            `Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()`,\n        );\n      }\n    }\n  }\n\n  private _replayLogOnce() {\n    if (!this._log.length)\n      return;\n\n    let lastLogTime = -1;\n    let isPaused = false;\n\n    for (const { type, time, param } of this._log) {\n      if (!isPaused && lastLogTime !== -1)\n        this._advanceNow(shiftTicks(this._now.ticks, time - lastLogTime));\n      lastLogTime = time;\n","sourceCodeStart":414,"sourceCodeEnd":450,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/injected/src/clock.ts#L414-L450","documentation":"Error \"Cannot clear timer: timer created with ${schedule}() but cleared with ${clear}()\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/injected/src/clock.ts:432 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}