{"record":{"id":"6147fbe16f6566c1","repo":"vercel/next.js","slug":"server-action-actionid-was-not-found-on-the-s","errorCode":null,"errorMessage":"Server Action \"${actionId}\" was not found on the server. \nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action","messagePattern":"Server Action \"(.+?)\" was not found on the server\\. \nRead more: https://nextjs\\.org/docs/messages/failed-to-find-server-action","errorType":"exception","errorClass":"UnrecognizedActionError","httpStatus":null,"severity":"error","filePath":"packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts","lineNumber":176,"sourceCode":"        require('../../offline') as typeof import('../../offline')\n      if (checkOfflineError(err)) {\n        // It's safe to replay the action because the fetch rejection\n        // means the request never reached the server — there are no\n        // side effects to duplicate.\n        const offline = getOffline()\n        if (offline !== null) {\n          await waitForConnection(offline)\n        }\n        return fetchServerAction(state, nextUrl, action)\n      }\n    }\n    throw err\n  }\n\n  // Handle server actions that the server didn't recognize.\n  const unrecognizedActionHeader = res.headers.get(NEXT_ACTION_NOT_FOUND_HEADER)\n  if (unrecognizedActionHeader === '1') {\n    throw new UnrecognizedActionError(\n      `Server Action \"${actionId}\" was not found on the server. \\nRead more: https://nextjs.org/docs/messages/failed-to-find-server-action`\n    )\n  }\n\n  const redirectHeader = res.headers.get('x-action-redirect')\n  const [location, _redirectType] = redirectHeader?.split(';') || []\n  let redirectType: RedirectType | undefined\n  switch (_redirectType) {\n    case 'push':\n      redirectType = 'push'\n      break\n    case 'replace':\n      redirectType = 'replace'\n      break\n    default:\n      redirectType = undefined\n  }\n","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/vercel/next.js/blob/0ae8c72462952df163f1b1e0726641bc5b40dc93/packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts#L158-L194","documentation":"Thrown as `UnrecognizedActionError` when the server responds to a Server Action POST with the `NEXT_ACTION_NOT_FOUND_HEADER` set to `'1'` (server-action-reducer.ts:174-179). The header means the server's deployed build has no action registered under the `actionId` the client sent. The canonical cause is a client/server build mismatch: the browser holds a stale bundle referencing an action ID that the current server deployment does not export.","triggerScenarios":"The browser loaded an older JS bundle whose action reference IDs do not match the server's current `SERVER_REFERENCE_MANIFEST`; a new deployment went out while a user had a tab open; multi-zone setups where the POST is routed to a zone that lacks the action; HMR in dev left a stale reference after the action was renamed/deleted.","commonSituations":"Long-lived browser sessions across a redeploy; preview deployments where the client cache is stale; renaming or deleting a Server Action without a hard refresh; CDN serving mismatched chunks; load balancer splitting traffic between two versions during a rollout.","solutions":["Reload the page (hard refresh) so the browser fetches the current bundle whose action IDs match the server.","Use `unstable_isUnrecognizedActionError` in a Client Component catch block to detect this and prompt the user to refresh, rather than showing a raw error.","Ensure zero-downtime deploys finish before routing traffic to the new build, or drain old instances first.","In dev, restart the dev server and clear `.next` to regenerate manifests."],"exampleFix":"// before\n'use client'\nawait myAction()\n\n// after\n'use client'\nimport { unstable_isUnrecognizedActionError } from 'next/navigation'\ntry {\n  await myAction()\n} catch (err) {\n  if (unstable_isUnrecognizedActionError(err)) {\n    window.location.reload()\n    return\n  }\n  throw err\n}","handlingStrategy":"try-catch","validationCode":"// Cannot fully prevent — deployment mismatch is server-driven.\n// But you can detect build staleness client-side:\n// Compare a build-id exposed via __NEXT_DATA__ to the latest on reload.","typeGuard":"// Client Component only:\nimport { unstable_isUnrecognizedActionError } from 'next/navigation'\nfunction isUnrecognizedAction(e: unknown): boolean {\n  return unstable_isUnrecognizedActionError(e)\n}","tryCatchPattern":"'use client'\nimport { unstable_isUnrecognizedActionError } from 'next/navigation'\ntry {\n  await myAction()\n} catch (err) {\n  if (unstable_isUnrecognizedActionError(err)) {\n    // Prompt user to refresh; the client bundle is stale.\n    if (confirm('A new version is available. Reload?')) window.location.reload()\n    return\n  }\n  throw err\n}","preventionTips":["Wrap Server Action calls in a helper that catches UnrecognizedActionError and auto-reloads.","Use zero-downtime deploys and drain old instances so clients never hit a mismatched server.","Surface a friendly 'refresh required' UI instead of a raw error for long-lived sessions."],"tags":["server-actions","deployment","app-router","version-mismatch"],"analyzedSha":"0ae8c72462952df163f1b1e0726641bc5b40dc93","analyzedAt":"2026-08-06T19:44:29.143Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}