{"record":{"id":"627a61e37d46a5db","repo":"parcel-bundler/parcel","slug":"the-image-transformer-does-not-support-asset-typ","errorCode":null,"errorMessage":"The image transformer does not support ${asset.type} images.","messagePattern":"The image transformer does not support (.+?) images\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/transformers/image/src/ImageTransformer.js","lineNumber":43,"sourceCode":"    let configFile: any = await config.getConfig(\n      ['sharp.config.json'], // '.sharprc', '.sharprc.json'\n      {packageKey: 'sharp'},\n    );\n\n    if (configFile?.contents) {\n      validateConfig(configFile.contents, configFile.filePath);\n      return configFile.contents;\n    } else {\n      return {};\n    }\n  },\n\n  async transform({config, asset, options}) {\n    asset.bundleBehavior = 'isolated';\n\n    const originalFormat = FORMATS.get(asset.type);\n    if (!originalFormat) {\n      throw new Error(\n        `The image transformer does not support ${asset.type} images.`,\n      );\n    }\n\n    const width = asset.query.has('width')\n      ? parseInt(asset.query.get('width'), 10)\n      : null;\n    const height = asset.query.has('height')\n      ? parseInt(asset.query.get('height'), 10)\n      : null;\n    const quality = asset.query.has('quality')\n      ? parseInt(asset.query.get('quality'), 10)\n      : config.quality;\n    let targetFormat = asset.query.get('as')?.toLowerCase().trim();\n    if (targetFormat && !FORMATS.has(targetFormat)) {\n      throw new Error(\n        `The image transformer does not support ${targetFormat} images.`,\n      );","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/transformers/image/src/ImageTransformer.js#L25-L61","documentation":"Thrown by @parcel/transformer-image when the input asset's type is not in the FORMATS map (jpeg/jpg/png/webp/gif/tiff/avif/heic/heif). The image transformer only processes raster formats Sharp supports; any other asset type routed to it bails here.","triggerScenarios":"An asset whose extension is not in the supported list reaches this transformer's transform() (e.g. .svg, .bmp, .ico, .jfif). The check uses asset.type, which is the Parcel asset type derived from the file extension or a prior transformer.","commonSituations":"Trying to resize/convert an SVG with the image transformer (SVG is handled by a different transformer); configuring .parcelrc to route .ico/.bmp/etc. to @parcel/transformer-image; misconfigured asset pipeline sending unsupported raster formats.","solutions":["Verify the file is a supported raster format (png/jpeg/webp/gif/tiff/avif/heic/heif).","For SVG, use the SVG transformer or an SVG-aware pipeline; do not route it through @parcel/transformer-image.","If you genuinely need a new format, pre-convert the asset to a supported one or write a transformer that converts the asset.type before this transformer runs.","Audit .parcelrc for a custom `*.{ico,bmp}` -> @parcel/transformer-image mapping and remove it."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"const SUPPORTED_INPUT = new Set(['jpeg','jpg','png','webp','gif','tiff','avif','heic','heif']);\nfunction isSupportedImageType(type) {\n  return SUPPORTED_INPUT.has(type);\n}","typeGuard":"function isSupportedImageAsset(asset) {\n  return ['jpeg','jpg','png','webp','gif','tiff','avif','heic','heif'].includes(asset.type);\n}","tryCatchPattern":null,"preventionTips":["Do not route SVG/ICO/BMP through @parcel/transformer-image; use a dedicated transformer.","Document supported raster extensions in your project README."],"tags":["image","sharp","transformer","unsupported-format"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}