{"record":{"id":"40875b291c465680","repo":"gatsbyjs/gatsby","slug":"format-is-not-a-valid-format-valid-formats-are","errorCode":null,"errorMessage":"${format} is not a valid format. Valid formats are: jpg, jpeg, png, webp, auto","messagePattern":"(.+?) is not a valid format\\. Valid formats are: jpg, jpeg, png, webp, auto","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-shopify/src/get-shopify-image.ts","lineNumber":16,"sourceCode":"import {\n  IUrlBuilderArgs,\n  getImageData,\n  IGatsbyImageData,\n} from \"gatsby-plugin-image\"\n\nconst validFormats = new Set([`jpg`, `jpeg`, `png`, `webp`, `auto`])\n\nexport function urlBuilder({\n  width,\n  height,\n  baseUrl,\n  format,\n}: IUrlBuilderArgs<unknown>): string {\n  if (!validFormats.has(format)) {\n    console.warn(\n      `${format} is not a valid format. Valid formats are: ${[\n        ...validFormats,\n      ].join(`, `)}`\n    )\n    format = `auto`\n  }\n\n  let [basename, version] = baseUrl.split(`?`)\n\n  const dot = basename.lastIndexOf(`.`)\n  let ext = ``\n  if (dot !== -1) {\n    ext = basename.slice(dot + 1)\n    basename = basename.slice(0, dot)\n  }\n  let suffix = ``\n  if (format === ext || format === `auto`) {\n    suffix = `.${ext}`","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-shopify/src/get-shopify-image.ts#L1-L34","documentation":"In urlBuilder for Shopify images, the requested format is validated against jpg, jpeg, png, webp, and auto. When a caller passes an unsupported format, the warning fires and the format is coerced to auto, so the generated CDN URL uses Shopify's automatic format selection instead of the requested one.","triggerScenarios":"Thrown at packages/gatsby-source-shopify/src/get-shopify-image.ts:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass one of the valid formats (jpg, jpeg, png, webp, auto) in image transform options.","Remove the explicit format option to let it default to auto.","If another format is genuinely needed, check whether Shopify's CDN supports it before requesting."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}