{"record":{"id":"73f751b2ded5919c","repo":"Kong/insomnia","slug":"postmutatedcontext-error","errorCode":null,"errorMessage":"postMutatedContext.error","messagePattern":"postMutatedContext\\.error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/network/send-request.node.ts","lineNumber":133,"sourceCode":"    const res = await responseTransform(response, environmentId, renderedRequest, renderedResult.context);\n\n    if (res.error) {\n      throw new Error(res.error);\n    }\n\n    const postMutatedContext = await tryToExecuteAfterResponseScript({\n      ...requestData,\n      ...mutatedContext,\n      runtime: defaultSendActionRuntime,\n      transientVariables: mutatedContext.transientVariables || transientVariables,\n      response,\n    });\n    if ('error' in postMutatedContext) {\n      console.error(\n        '[network] An error occurred while running after-response script for request named:',\n        renderedRequest.name,\n      );\n      throw new Error(postMutatedContext.error);\n    }\n    const { statusCode: status, statusMessage, headers: headerArray, elapsedTime: responseTime } = res;\n\n    const headers = headerArray?.reduce<Record<string, string>>(\n      (acc, { name, value }) => ({ ...acc, [name.toLowerCase() || '']: value || '' }),\n      {},\n    );\n    const bodyBuffer = (await services.helpers.getResponseBodyBuffer(res)) as Buffer;\n    const data = bodyBuffer ? bodyBuffer.toString('utf8') : undefined;\n\n    const testResults = [\n      ...(mutatedContext.requestTestResults || []),\n      ...(postMutatedContext.requestTestResults || []),\n    ];\n    return {\n      status,\n      statusMessage,\n      data,","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/network/send-request.node.ts#L115-L151","documentation":"Error \"postMutatedContext.error\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/network/send-request.node.ts:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}