{"record":{"id":"44e7d5af11fe1888","repo":"vercel/next.js","slug":"route-workstore-route-used-unstable-navigation","errorCode":null,"errorMessage":"Route ${workStore.route} used `unstable_navigation()`, which requires Cache Components to be enabled. Learn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents","messagePattern":"Route (.+?) used `unstable_navigation\\(\\)`, which requires Cache Components to be enabled\\. Learn more: https://nextjs\\.org/docs/app/api-reference/config/next-config-js/cacheComponents","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/request/cache-stages.ts","lineNumber":187,"sourceCode":" * rendering cost.\n *\n * It has no effect during static prerendering — static output is computed\n * once and shared across many clients, so there's no per-request cost to\n * save — and no effect on the initial load of a page.\n *\n * Unlike `connection()`, it does not mark the subtree as request-dependent —\n * content below `await unstable_navigation()` remains fully cacheable.\n */\nexport function unstable_navigation(): Promise<void> {\n  const workStore = workAsyncStorage.getStore()\n  const workUnitStore = workUnitAsyncStorage.getStore()\n\n  if (!workStore || !workUnitStore) {\n    const callingExpression = 'unstable_navigation'\n    throwForMissingRequestStore(callingExpression)\n  }\n  if (!process.env.__NEXT_CACHE_COMPONENTS) {\n    throw new Error(\n      `Route ${workStore.route} used \\`unstable_navigation()\\`, which requires Cache Components to be enabled. Learn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents`\n    )\n  }\n\n  if (!isRequestApiAllowedInCurrentPhase(workUnitStore)) {\n    throw new Error(\n      `Route ${workStore.route} used \\`unstable_navigation()\\` inside \\`after()\\` while rendering. The \\`unstable_navigation()\\` function is used to indicate the subsequent code must only run during an actual navigation, but \\`after()\\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/after`\n    )\n  }\n\n  switch (workUnitStore.type) {\n    case 'prerender': {\n      // Static prerenders are computed once and shared across many\n      // clients, so there's no per-request prefetch cost to save by\n      // deferring the content — it's deliberately included in the static\n      // output (and thus in static prefetches).\n      // However, it's excluded from the shell, and has to be separated from\n      // unstable_prefetch(), so we have to delay it.","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/vercel/next.js/blob/258b1c1bc05f7099816b88f70b7b3422b24a4b8d/packages/next/src/server/request/cache-stages.ts#L169-L205","documentation":"Error \"Route ${workStore.route} used `unstable_navigation()`, which requires Cache Components to be enabled. Learn more: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheComponents\" thrown in vercel/next.js.","triggerScenarios":"Thrown at packages/next/src/server/request/cache-stages.ts:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable Cache Components with experimental.cacheComponents: true in next.config.js","Remove the unstable_navigation() call from the route","Gate the call behind a check that Cache Components is enabled before using navigation-stage APIs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"258b1c1bc05f7099816b88f70b7b3422b24a4b8d","analyzedAt":"2026-08-21T19:56:13.433Z","contentChangedAt":"2026-08-21T19:56:13.433Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}