{"record":{"id":"540c7940b82929b4","repo":"gatsbyjs/gatsby","slug":"either-the-width-or-height-argument-is-540c79","errorCode":null,"errorMessage":"\n      Either the \"width\" or \"height\" argument is required for \"${source.url}\"\n    ","messagePattern":"\n      Either the \"width\" or \"height\" argument is required for \"(.+?)\"\n    ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-utils/src/polyfill-remote-file/graphql/gatsby-image-resolver.ts","lineNumber":102,"sourceCode":"  store?: Store\n): Promise<{\n  images: IGatsbyImageData\n  layout: string\n  width: number\n  height: number\n  backgroundColor?: string\n  placeholder?: { fallback: string } | undefined\n} | null> {\n  if (!isImage(source)) {\n    return null\n  }\n\n  if (!args.layout) {\n    throw new Error(`The \"layout\" argument is required for \"${source.url}\"`)\n  }\n\n  if (!args.width && !args.height) {\n    throw new Error(`\n      Either the \"width\" or \"height\" argument is required for \"${source.url}\"\n    `)\n  }\n\n  if (!args.formats) {\n    args.formats = [`auto`, `webp`, `avif`]\n  }\n\n  if (!args.outputPixelDensities) {\n    args.outputPixelDensities = DEFAULT_PIXEL_DENSITIES\n  }\n\n  if (!args.breakpoints) {\n    args.breakpoints = DEFAULT_BREAKPOINTS\n  }\n\n  if (!args.fit) {\n    args.fit = `cover`","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-utils/src/polyfill-remote-file/graphql/gatsby-image-resolver.ts#L84-L120","documentation":"gatsbyImageResolver validates resolver args upfront: after requiring layout, it requires that at least one of width or height be present so image dimensions can be derived. Both absent means the GraphQL field was queried without sizing arguments (and no defaults apply).","triggerScenarios":"Thrown at packages/gatsby-plugin-utils/src/polyfill-remote-file/graphql/gatsby-image-resolver.ts:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass width or height to the gatsbyImage field in the query","Set a layout plus one dimension in the GraphQL argument","Rely on the parent resolver defaults instead of calling with empty args"],"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"}