{"record":{"id":"3a8654d0f5de66c0","repo":"microsoft/playwright","slug":"can-t-install-fake-timers-twice-on-the-same-global","errorCode":null,"errorMessage":"Can't install fake timers twice on the same global object.","messagePattern":"Can't install fake timers twice on the same global object\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/injected/src/clock.ts","lineNumber":796,"sourceCode":"      const timerId = originals.bound.setTimeout(task, timeout);\n      return () => originals.bound.clearTimeout(timerId);\n    },\n    setInterval: (task: () => void, delay: number) => {\n      const intervalId = originals.bound.setInterval(task, delay);\n      return () => originals.bound.clearInterval(intervalId);\n    },\n  };\n\n  const clock = new ClockController(embedder);\n  const api = createApi(clock, originals.bound, config.browserName);\n  return { clock, api, originals: originals.raw };\n}\n\nexport function install(globalObject: WindowOrWorkerGlobalScope, config: InstallConfig = {}): { clock: ClockController, api: Builtins, originals: Builtins } {\n  if ((globalObject as any).Date?.isFake) {\n    // Timers are already faked; this is a problem.\n    // Make the user reset timers before continuing.\n    throw new TypeError(`Can't install fake timers twice on the same global object.`);\n  }\n\n  const { clock, api, originals } = createClock(globalObject, config);\n  const toFake = config.toFake?.length ? config.toFake : Object.keys(originals) as (keyof Builtins)[];\n\n  for (const method of toFake) {\n    if (method === 'Date') {\n      (globalObject as any).Date = mirrorDateProperties(api.Date, (globalObject as any).Date);\n    } else if (method === 'Intl') {\n      (globalObject as any).Intl = api[method]!;\n    } else if (method === 'AbortSignal') {\n      (globalObject as any).AbortSignal = api[method]!;\n    } else if (method === 'performance') {\n      (globalObject as any).performance = api[method]!;\n      const kEventTimeStamp = Symbol('playwrightEventTimeStamp');\n      Object.defineProperty(Event.prototype, 'timeStamp', {\n        get() {\n          if (!this[kEventTimeStamp])","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/injected/src/clock.ts#L778-L814","documentation":"Error \"Can't install fake timers twice on the same global object.\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/injected/src/clock.ts:796 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-12T18:17:37.767Z"}