{"record":{"id":"2787837354281d4a","repo":"continuedev/continue","slug":"bedrock-failed-to-process-image-part","errorCode":null,"errorMessage":"Bedrock: failed to process image part","messagePattern":"Bedrock: failed to process image part","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/llm/llms/Bedrock.ts","lineNumber":586,"sourceCode":"              format === ImageFormat.WEBP ||\n              format === ImageFormat.GIF\n            ) {\n              blocks.push({\n                image: {\n                  format,\n                  source: {\n                    bytes: Uint8Array.from(Buffer.from(base64Data, \"base64\")),\n                  },\n                },\n              });\n            } else {\n              console.warn(\n                `Bedrock: skipping unsupported image part format: ${format}`,\n                part,\n              );\n            }\n          } else {\n            console.warn(\"Bedrock: failed to process image part\", part);\n          }\n        }\n      }\n    }\n    return blocks;\n  }\n\n  private async _getCredentials() {\n    if (this.accessKeyId && this.secretAccessKey) {\n      return {\n        accessKeyId: this.accessKeyId,\n        secretAccessKey: this.secretAccessKey,\n      };\n    }\n    const profile = this.profile ?? \"bedrock\";\n    try {\n      return await fromNodeProviderChain({\n        profile: profile,","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/Bedrock.ts#L568-L604","documentation":"While converting chat message content into Bedrock content blocks, an image part was encountered that did not match any supported format (e.g. base64 data URL with known mime type). The unsupported part is skipped with a warning and the rest of the message is still sent.","triggerScenarios":"Calling Bedrock chat with a message whose content includes an image part whose url is not a well-formed data: URL (http(s) remote URL, relative path, or malformed base64), or an image format Bedrock does not accept.","commonSituations":"Passing a remote image URL instead of base64 data URL; frontend sending an object URL or empty string; upstream provider returning a non-data-URL image reference.","solutions":["Ensure image parts use data URLs like data:image/png;base64,... with a supported mime type (png/jpeg/gif/webp)","If you have a remote URL, fetch and convert it to a base64 data URL before sending","Log part.imageUrl.url at debug level to identify which message produced it"],"exampleFix":"// before\ncontent: [{ type: \"image\", url: \"https://example.com/cat.png\" }]\n// after\nconst b64 = await fetch(url).then(r => `data:${r.headers.get(\"content-type\")};base64,${Buffer.from(await r.arrayBuffer()).toString(\"base64\")}`);\ncontent: [{ type: \"image\", url: b64 }]","handlingStrategy":"validation","validationCode":"const ok = p => typeof p.imageUrl?.url === \"string\" && /^data:image\\/(png|jpe?g|gif|webp);base64,[A-Za-z0-9+/=]+$/.test(p.imageUrl.url);","typeGuard":"const isSupportedBedrockImage = (p: ChatMessagePart): p is { type: \"image\"; url: string } =>\n  !!p.imageUrl?.url && /^data:image\\/(png|jpe?g|gif|webp);base64,/.test(p.imageUrl.url);","tryCatchPattern":null,"preventionTips":["Always inline images as base64 data URLs before building messages","Convert remote URLs server-side before calling the LLM","Strip empty image parts from content arrays"],"tags":["bedrock","image","data-url","multimodal"],"backgroundTag":"invalid-data-url-image","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}