{"id":"5f245b70793afd57","repo":"jestjs/jest","slug":"unexpected-request-from-parent-process-request-5f245b","errorCode":null,"errorMessage":"Unexpected request from parent process: ${request[0]}","messagePattern":"Unexpected request from parent process: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/jest-worker/src/workers/threadChild.ts","lineNumber":92,"sourceCode":"\n        initialized = true;\n\n        if (main.setup) {\n          execFunction(\n            main.setup,\n            main,\n            setupArgs,\n            reportSuccess,\n            reportInitializeError,\n          );\n        } else {\n          reportSuccess(void 0);\n        }\n      }\n      break;\n\n    default:\n      throw new TypeError(\n        `Unexpected request from parent process: ${request[0]}`,\n      );\n  }\n};\nparentPort!.on('message', messageListener);\n\nfunction reportMemoryUsage() {\n  if (isMainThread) {\n    throw new Error('Child can only be used on a forked process');\n  }\n\n  const msg: ParentMessageMemUsage = [\n    PARENT_MESSAGE_MEM_USAGE,\n    process.memoryUsage().heapUsed,\n  ];\n\n  parentPort!.postMessage(msg);\n}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/jestjs/jest/blob/f49721c78e195558b40913977c9230f5b7f559d8/packages/jest-worker/src/workers/threadChild.ts#L74-L110","documentation":"Error \"Unexpected request from parent process: ${request[0]}\" thrown in jestjs/jest.","triggerScenarios":"Thrown at packages/jest-worker/src/workers/threadChild.ts:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Internal Jest error: the parent process sent an unrecognized request type to a worker thread. Ensure the parent and worker run the same Jest version; if the mismatch persists, upgrade Jest and report the issue."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"f49721c78e195558b40913977c9230f5b7f559d8","analyzedAt":"2026-08-03T20:16:28.571Z","schemaVersion":2}