{"record":{"id":"0cb439a8e346a7d1","repo":"continuedev/continue","slug":"response-body-is-null","errorCode":null,"errorMessage":"Response body is null","messagePattern":"Response body is null","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"core/commands/slash/built-in-legacy/http.ts","lineNumber":25,"sourceCode":"  description: \"Call an HTTP endpoint to serve response\",\n  run: async function* ({ ide, llm, input, params, fetch }) {\n    const url = params?.url;\n    if (!url) {\n      throw new Error(\"URL is not defined in params\");\n    }\n    const response = await fetch(url, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({\n        input: removeQuotesAndEscapes(input),\n      }),\n    });\n\n    // Stream the response\n    if (response.body === null) {\n      throw new Error(\"Response body is null\");\n    }\n    for await (const chunk of streamResponse(response)) {\n      yield chunk;\n    }\n  },\n};\n\nexport default HttpSlashCommand;\n","sourceCodeStart":7,"sourceCodeEnd":34,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/commands/slash/built-in-legacy/http.ts#L7-L34","documentation":"Generic wrapper thrown when anything inside the keyJson setup path throws — JSON.parse failure, fromJSON errors, or the inner non-JWT check being caught and rewrapped. The original exception is swallowed, so the real cause (usually malformed JSON or missing fields) is hidden.","triggerScenarios":"config.keyJson is not parseable JSON (trailing comma, smart quotes from copy/paste, BOM, truncated env var) or auth.fromJSON throws because required service-account fields (client_email, private_key, project_id) are missing or empty.","commonSituations":"Key pasted into a .env file where newlines break the value; key JSON stored in a secret manager that mangles quotes; key truncated by terminal copy; env var containing the literal string 'undefined'.","solutions":["Validate keyJson parses before constructing: JSON.parse it yourself and log the real error","Check the secret round-trips intact (compare length/hash against the original file)","Store the key as a file and pass keyFile instead of keyJson","Inspect for BOM or smart-quote characters introduced by editors/docs"],"exampleFix":"// before\nnew VertexAIApi({ keyJson: process.env.GCP_KEY_JSON });\n\n// after\nlet creds;\ntry { creds = JSON.parse(process.env.GCP_KEY_JSON!); } catch (e) { throw new Error(`bad keyJson: ${e.message}`); }\nnew VertexAIApi({ keyJson: creds });","handlingStrategy":"validation","validationCode":"try { const p = JSON.parse(keyJson); if (!p.client_email || !p.private_key) throw new Error('missing service-account fields'); } catch (e) { throw new Error(`keyJson invalid: ${(e as Error).message}`); }","typeGuard":null,"tryCatchPattern":"try { new VertexAIApi({ keyJson }); } catch (e) { if ((e as Error).message.includes('Failed to parse keyJson')) { /* re-parse yourself to surface the real cause */ } throw e; }","preventionTips":["Store secrets unmodified; compare hashes after round-tripping through env/secret managers","Prefer keyFile paths over inlined JSON in env vars","Never build key JSON by string concatenation"],"tags":["vertexai","authentication","json-parse","credentials"],"backgroundTag":"credentials-parse-failure","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}