{"record":{"id":"48b5c106c7afd584","repo":"facebook/react","slug":"invalid-server-action-ref","errorCode":null,"errorMessage":"Invalid server action: ${ref}","messagePattern":"Invalid server action: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server-dom-parcel/src/client/ReactFlightClientConfigBundlerParcel.js","lineNumber":62,"sourceCode":"\nexport function resolveClientReference<T>(\n  bundlerConfig: null,\n  metadata: ClientReferenceMetadata,\n): ClientReference<T> {\n  // Reference is already resolved during the build.\n  return metadata;\n}\n\nexport function resolveServerReference<T>(\n  bundlerConfig: ServerManifest,\n  ref: ServerReferenceId,\n): ClientReference<T> {\n  const idx = ref.lastIndexOf('#');\n  const id = ref.slice(0, idx);\n  const name = ref.slice(idx + 1);\n  const bundles = bundlerConfig[id];\n  if (!bundles) {\n    throw new Error('Invalid server action: ' + ref);\n  }\n  return [id, name, bundles];\n}\n\nexport function preloadModule<T>(\n  metadata: ClientReference<T>,\n): null | Thenable<any> {\n  if (metadata[IMPORT_MAP]) {\n    parcelRequire.extendImportMap(metadata[IMPORT_MAP]);\n  }\n\n  if (metadata[BUNDLES].length === 0) {\n    return null;\n  }\n\n  return Promise.all(metadata[BUNDLES].map(url => parcelRequire.load(url)));\n}\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server-dom-parcel/src/client/ReactFlightClientConfigBundlerParcel.js#L44-L80","documentation":"On the Parcel client, resolveServerReference splits a serialized id '<moduleId>#<exportName>' and requires bundlerConfig[moduleId] — the Server Manifest entry describing which bundles to load. The manifest is the second argument passed to createFromFetch/createFromNodeStream/createFromReadableStream. An unknown id means the client cannot locate the module implementing the action, so the call is rejected before any request is made.","triggerScenarios":"Invoking a server function whose module id is absent from the manifest passed to createFrom*; a ref without a '#' so the parsed id is garbage; a manifest generated by an older build than the payload that references the action.","commonSituations":"Adding a new server action but shipping a stale client manifest; build pipelines emitting client and server artifacts from different revisions; passing the client-reference manifest where the server manifest belongs.","solutions":["Rebuild so the server manifest includes the new action's module id, and pass that manifest as the second argument to createFrom*","Verify the id before calling: const id = ref.slice(0, ref.lastIndexOf('#')); if (!manifest[id]) the manifest is stale","Make the payload and the manifest come from the same build artifact so ids never drift"],"exampleFix":"// before — manifest predates the action\nconst data = createFromFetch(fetch('/endpoint'), staleServerManifest);\nawait data.saveNote(); // Invalid server action: notes/saveNote#saveNote\n\n// after — payload and manifest ship from the same build\nconst build = await import(`./build/manifest-${BUILD_ID}.js`);\nconst data = createFromFetch(fetch('/endpoint'), build.serverManifest);\nawait data.saveNote();","handlingStrategy":"validation","validationCode":"export function isKnownServerAction(manifest, ref) {\n  const idx = ref.lastIndexOf('#');\n  return idx > 0 && Object.prototype.hasOwnProperty.call(manifest, ref.slice(0, idx));\n}\n// before invoking: if (!isKnownServerAction(serverManifest, id)) { refresh the manifest or surface an error }","typeGuard":"export function parseServerReference(ref) {\n  const idx = ref.lastIndexOf('#');\n  return idx > 0 ? {id: ref.slice(0, idx), name: ref.slice(idx + 1)} : null;\n}","tryCatchPattern":"try {\n  await action(...args);\n} catch (e) {\n  if (/Invalid server action/.test(e.message)) {\n    // manifest drift — reload the manifest for the current build and retry once\n  }\n  throw e;\n}","preventionTips":["Ship the server manifest and the payload from the same build artifact","Rebuild both client and server outputs after adding server actions","Guard call sites with isKnownServerAction so drift fails with a clear message"],"tags":["react-server-components","server-actions","parcel","manifest"],"backgroundTag":"server-reference-manifest-missing-entry","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}