{"record":{"id":"8f3576dca41fa49e","repo":"denoland/deno","slug":"err-child-process-ipc-required","errorCode":"ERR_CHILD_PROCESS_IPC_REQUIRED","errorMessage":"Forked processes must have an IPC channel, missing value 'ipc' in options.stdio","messagePattern":"Forked processes must have an IPC channel, missing value 'ipc' in options\\.stdio","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/child_process.ts","lineNumber":285,"sourceCode":"    if (result.traceEventCategories) {\n      options.env = {\n        ...(options.env ?? lazyProcess().default.env),\n        DENO_NODE_TRACE_EVENT_CATEGORIES: result.traceEventCategories,\n      };\n    }\n  }\n\n  if (typeof options.stdio === \"string\") {\n    options.stdio = stdioStringToArray(options.stdio, \"ipc\");\n  } else if (!ArrayIsArray(options.stdio)) {\n    // Use a separate fd=3 for the IPC channel. Inherit stdin, stdout,\n    // and stderr from the parent if silent isn't set.\n    options.stdio = stdioStringToArray(\n      options.silent ? \"pipe\" : \"inherit\",\n      \"ipc\",\n    );\n  } else if (!ArrayPrototypeIncludes(options.stdio, \"ipc\")) {\n    throw new ERR_CHILD_PROCESS_IPC_REQUIRED(\"options.stdio\");\n  }\n\n  options.execPath = options.execPath || Deno.execPath();\n  options.shell = false;\n\n  // deno-lint-ignore no-explicit-any\n  (options as any)[kNeedsNpmProcessState] = true;\n\n  return spawn(options.execPath, args, options);\n}\n\nfunction spawn(\n  command: string,\n  argsOrOptions?: string[] | SpawnOptions,\n  maybeOptions?: SpawnOptions,\n): ChildProcess {\n  const args = ArrayIsArray(argsOrOptions) ? argsOrOptions : [];\n  let options = !ArrayIsArray(argsOrOptions) && argsOrOptions != null","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/ext/node/polyfills/child_process.ts#L267-L303","documentation":"fork() starts a child process that talks to the parent over an IPC channel, so options.stdio must include 'ipc'. If stdio is an array without an 'ipc' entry, ERR_CHILD_PROCESS_IPC_REQUIRED is thrown. A stdio string such as 'pipe' is safe: stdioStringToArray() appends 'ipc' automatically.","triggerScenarios":"fork(modulePath, args, { stdio: ['ignore', 'pipe', 'pipe'] }). Any stdio array like ['ignore'] or ['pipe', 'pipe'] that omits 'ipc'. Copying a spawn() options object into fork() without changes.","commonSituations":"Shared process options reused for both spawn() and fork(). Code tuned to silence child output ('ignore') that also drops the IPC entry. Migration from spawn() to fork() for messaging without a stdio review.","solutions":["Add 'ipc' to the stdio array: stdio: ['ignore', 'inherit', 'inherit', 'ipc'].","Omit stdio entirely and let fork() configure it, or pass a stdio string.","Use spawn() instead when you do not need channel messaging."],"exampleFix":"// before\nfork(workerPath, [], { stdio: ['ignore', 'pipe', 'pipe'] });\n\n// after\nfork(workerPath, [], { stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });","handlingStrategy":"validation","validationCode":"const stdio = Array.isArray(opts.stdio) ? opts.stdio : null;\nif (stdio && !stdio.includes('ipc')) stdio.push('ipc');\nfork(modulePath, args, stdio ? { ...opts, stdio } : opts);","typeGuard":"function hasIpc(stdio: unknown): boolean { return Array.isArray(stdio) && stdio.includes('ipc'); }","tryCatchPattern":"try { fork(modulePath, args, opts); } catch (e) { if (e.code === 'ERR_CHILD_PROCESS_IPC_REQUIRED') { opts = { ...opts, stdio: [...(opts.stdio ?? []), 'ipc'] }; fork(modulePath, args, opts); } else throw e; }","preventionTips":["Centralize fork() options in one place and assert the stdio array contains 'ipc'.","Prefer a stdio string or no stdio option for fork()."],"tags":["child-process","fork","ipc","stdio"],"backgroundTag":"missing-ipc-channel","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}