{"record":{"id":"df7cc75bcdf99c12","repo":"vercel/ai","slug":"unsupported-task-type-tasktype","errorCode":null,"errorMessage":"Unsupported task type: ${taskType}","messagePattern":"Unsupported task type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/amazon-bedrock/src/amazon-bedrock-image-model.ts","lineNumber":220,"sourceCode":"              ? { negativeText: amazonBedrockOptions.negativeText }\n              : {}),\n            ...(amazonBedrockOptions?.similarityStrength != null\n              ? {\n                  similarityStrength: amazonBedrockOptions.similarityStrength,\n                }\n              : {}),\n          };\n\n          args = {\n            taskType: 'IMAGE_VARIATION',\n            imageVariationParams,\n            imageGenerationConfig,\n          };\n          break;\n        }\n\n        default:\n          throw new Error(`Unsupported task type: ${taskType}`);\n      }\n    } else {\n      // Standard image generation mode\n      args = {\n        taskType: 'TEXT_IMAGE',\n        textToImageParams: {\n          text: prompt,\n          ...(amazonBedrockOptions?.negativeText\n            ? {\n                negativeText: amazonBedrockOptions.negativeText,\n              }\n            : {}),\n          ...(amazonBedrockOptions?.style\n            ? {\n                style: amazonBedrockOptions.style,\n              }\n            : {}),\n        },","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/amazon-bedrock/src/amazon-bedrock-image-model.ts#L202-L238","documentation":"The Bedrock image model (Nova Canvas) maps ImageModelV4 prompt composition to Nova task types (TEXT_IMAGE, COLOR_GUIDED_GENERATION, IMAGE_VARIATION, INPAINT, OUTPAINT, etc.). The switch over taskType has no default mapping for the value computed, so doGenerate throws 'Unsupported task type'. This indicates an internal mapping gap, usually from an image editing mode the provider package doesn't yet translate.","triggerScenarios":"Calling generateImage with a bedrock image model using an editing mode (e.g. a new/unsupported combination of images + mask) that maps to a Nova taskType the package has no case for.","commonSituations":"Using image editing features (inpainting/outpainting/color-guided) added to the core SDK before @ai-sdk/amazon-bedrock added support; passing multiple reference images in a way that produces an unmapped task type; outdated provider package.","solutions":["Update @ai-sdk/amazon-bedrock to the latest version for expanded Nova Canvas task support","Simplify the request to a supported mode — e.g. plain text-to-image via generateImage({ model, prompt })","Check which editing inputs you're passing (images/masks) and align them with documented Nova Canvas modes","If you need an unsupported task type, open an issue / file a PR against the bedrock image model"],"exampleFix":"// before\nawait generateImage({ model, prompt, images: [ref1, ref2] }); // unmapped editing combo\n// after\nawait generateImage({ model, prompt }); // standard TEXT_IMAGE mode","handlingStrategy":"try-catch","validationCode":"// ensure the editing mode you use is supported by the installed provider version\nconst supported = ['TEXT_IMAGE','COLOR_GUIDED_GENERATION','IMAGE_VARIATION','INPAINT','OUTPAINT'];","typeGuard":null,"tryCatchPattern":"try {\n  await generateImage({ model, prompt, images });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unsupported task type')) {\n    // fall back to plain text-to-image or update the package\n  }\n}","preventionTips":["Keep @ai-sdk/amazon-bedrock current with the core `ai` package","Use only documented Nova Canvas editing modes","Prefer simple text-to-image unless editing support is confirmed"],"tags":["bedrock","image-generation","unsupported-functionality"],"backgroundTag":"unsupported-task-type","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}