{"record":{"id":"16f13ab16c1374cb","repo":"gatsbyjs/gatsby","slug":"no-valid-layout-was-provided-for-the-image-at-fi","errorCode":null,"errorMessage":"No valid layout was provided for the image at ${filename}. Valid image layouts are fixed, fullWidth, and constrained. Found ${layout}","messagePattern":"No valid layout was provided for the image at (.+?)\\. Valid image layouts are fixed, fullWidth, and constrained\\. Found (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-image/src/image-utils.ts","lineNumber":398,"sourceCode":"  const erroneousUserDimensions = Object.entries(userDimensions).filter(\n    ([_, size]) => typeof size === `number` && size < 1\n  )\n  if (erroneousUserDimensions.length) {\n    throw new Error(\n      `Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${erroneousUserDimensions\n        .map(dim => dim.join(`: `))\n        .join(`, `)}`\n    )\n  }\n\n  if (layout === `fixed`) {\n    return fixedImageSizes(args)\n  } else if (layout === `constrained`) {\n    return responsiveImageSizes(args)\n  } else if (layout === `fullWidth`) {\n    return responsiveImageSizes({ breakpoints, ...args })\n  } else {\n    reporter.warn(\n      `No valid layout was provided for the image at ${filename}. Valid image layouts are fixed, fullWidth, and constrained. Found ${layout}`\n    )\n    return {\n      sizes: [imgDimensions.width],\n      presentationWidth: imgDimensions.width,\n      presentationHeight: imgDimensions.height,\n      aspectRatio: imgDimensions.width / imgDimensions.height,\n      unscaledWidth: imgDimensions.width,\n    }\n  }\n}\nexport function fixedImageSizes({\n  filename,\n  sourceMetadata: imgDimensions,\n  width,\n  height,\n  fit = `cover`,\n  outputPixelDensities = DEFAULT_PIXEL_DENSITIES,","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-image/src/image-utils.ts#L380-L416","documentation":"Layout validation error path in calculateImageSizes: after checking user dimensions are positive numbers, the provided `layout` matched neither `fixed`, `constrained` nor `fullWidth`, so no sizing branch runs and this error identifying the invalid layout value is produced. The layout string usually comes from a <StaticImage> prop or gatsbyImageData layout argument.","triggerScenarios":"Thrown at packages/gatsby-plugin-image/src/image-utils.ts:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid layout (fixed, constrained or fullWidth) to the image resolver"],"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"}