{"record":{"id":"c8be42e1f56acc86","repo":"gatsbyjs/gatsby","slug":"failed-downloading-the-base64-image-for-url","errorCode":null,"errorMessage":"Failed downloading the base64 image for ${url}","messagePattern":"Failed downloading the base64 image for (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-remark-images-contentful/src/utils/index.js","lineNumber":19,"sourceCode":"const { URL } = require(`url`)\nconst axios = require(`axios`)\n\n// This should be replaced with the solution for https://github.com/gatsbyjs/gatsby/issues/24220\nconst getBase64Img = async (url, reporter) => {\n  try {\n    const response = await axios({\n      method: `GET`,\n      responseType: `arraybuffer`,\n      url: `${url}`,\n    })\n\n    const base64Img = `data:${\n      response.headers[`content-type`]\n    };base64,${new Buffer(response.data).toString(`base64`)}`\n\n    return base64Img\n  } catch (err) {\n    reporter.panic(`Failed downloading the base64 image for ${url}`, err)\n    return undefined\n  }\n}\n\nconst buildResponsiveSizes = async (\n  { metadata, imageUrl, options = {} },\n  reporter\n) => {\n  const imageURL = new URL(\n    imageUrl.indexOf(`/`) === 0 ? `https:${imageUrl}` : imageUrl\n  )\n\n  const { width, height, density } = metadata\n  const { maxWidth, sizes } = options\n  const aspectRatio = width / height\n\n  const presentationWidth = Math.min(maxWidth, width)\n  const presentationHeight = Math.round(presentationWidth * (height / width))","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-remark-images-contentful/src/utils/index.js#L1-L37","documentation":"Error \"Failed downloading the base64 image for ${url}\" thrown in gatsbyjs/gatsby.","triggerScenarios":"Thrown at packages/gatsby-remark-images-contentful/src/utils/index.js:19 when the library encounters an invalid state.","commonSituations":"Occurs when downloading a base64-encoded image from a remote URL fails inside gatsby-remark-images-contentful. Typically caused by network errors, expired URLs, or missing authentication. Verify the URL is publicly accessible and retry the build.","solutions":["Check the image URL is reachable from the build environment (no firewall or auth blocking the request).","Confirm the remote image still exists and returns a 200 status with an image content type."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}