{"record":{"id":"005446e6e7b62010","repo":"gatsbyjs/gatsby","slug":"no-valid-layout-was-provided-for-the-image-at-fi-005446","errorCode":null,"errorMessage":"No valid layout was provided for the image at ${file.absolutePath}. Valid image layouts are fixed, fullWidth, and constrained.","messagePattern":"No valid layout was provided for the image at (.+?)\\. Valid image layouts are fixed, fullWidth, and constrained\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-sharp/src/utils.js","lineNumber":37,"sourceCode":"  // check that all dimensions provided are positive\n  const userDimensions = { width, height }\n  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 === `fullWidth` || layout === `constrained`) {\n    return responsiveImageSizes(args)\n  } else {\n    reporter.warn(\n      `No valid layout was provided for the image at ${file.absolutePath}. Valid image layouts are fixed, fullWidth, and constrained.`\n    )\n    return []\n  }\n}\n\nexport function fixedImageSizes({\n  file,\n  imgDimensions,\n  width,\n  height,\n  transformOptions = {},\n  outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n  reporter,\n}) {\n  let aspectRatio = imgDimensions.width / imgDimensions.height\n  const { fit = `cover` } = transformOptions\n  // Sort, dedupe and ensure there's a 1","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-sharp/src/utils.js#L19-L55","documentation":"Layout validation error path in gatsby-plugin-sharp's calculateImageSizes: after verifying user-supplied width/height are positive, the `layout` matched neither `fixed` nor `fullWidth`/`constrained`, so no sizing branch applies and this error identifying the invalid layout value (and file.absolutePath) is produced.","triggerScenarios":"Thrown at packages/gatsby-plugin-sharp/src/utils.js:37 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid layout (fixed, fullWidth or constrained) 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-14T00:17:10.932Z"}