{"record":{"id":"f2490a1194036f9f","repo":"vercel/next.js","slug":"next-js-cannot-guarantee-that-cache-components-wil","errorCode":null,"errorMessage":"Next.js cannot guarantee that Cache Components will run as expected due to the current runtime's implementation of `setTimeout()`.\\nPlease report a github issue here: https://github.com/vercel/next.js/issues/new/","messagePattern":"Next\\.js cannot guarantee that Cache Components will run as expected due to the current runtime's implementation of `setTimeout\\(\\)`\\.\\\\nPlease report a github issue here: https://github\\.com/vercel/next\\.js/issues/new/","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/server/app-render/app-render-scheduling.ts","lineNumber":93,"sourceCode":"We can guarantee that multiple timers (with the same delay, usually `0`)\nrun together without any delays by making sure that their `_idleStart`s are the same,\nbecause that's what's used to determine if a timer should be deferred or not.\nLuckily, this property is currently exposed to userland and mutable,\nso we can patch it.\n\nAnother related trick we could potentially apply is making\na timer immediately be considered expired by doing  `timer._idleStart -= 2`.\n(the value must be more than `1`, the delay that actually gets set for `setTimeout(cb, 0)`).\nThis makes node view this timer as \"a 1ms timer scheduled 2ms ago\",\nmeaning that it should definitely run in the next timer phase.\nHowever, I'm not confident we know all the side effects of doing this,\nso for now, simply ensuring coordination is enough.\n*/\n\nlet shouldAttemptPatching = true\n\nfunction warnAboutTimers() {\n  console.warn(\n    \"Next.js cannot guarantee that Cache Components will run as expected due to the current runtime's implementation of `setTimeout()`.\\nPlease report a github issue here: https://github.com/vercel/next.js/issues/new/\"\n  )\n}\n\n/**\n * Allows scheduling multiple timers (equivalent to `setTimeout(cb, delayMs)`)\n * that are guaranteed to run in the same iteration of the event loop.\n *\n * @param delayMs - the delay to pass to `setTimeout`. (default: 0)\n *\n * */\nexport function createAtomicTimerGroup(delayMs = 0) {\n  if (process.env.NEXT_RUNTIME === 'edge') {\n    throw new InvariantError(\n      'createAtomicTimerGroup cannot be called in the edge runtime'\n    )\n  } else {\n    let isFirstCallback = true","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/app-render/app-render-scheduling.ts#L75-L111","documentation":"Error \"Next.js cannot guarantee that Cache Components will run as expected due to the current runtime's implementation of `setTimeout()`.\\nPlease report a github issue here: https://github.com/vercel/next.js/issues/new/\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/server/app-render/app-render-scheduling.ts:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run on a standard Node.js runtime with correct setTimeout semantics, or report the issue to Next.js."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}