diff --git a/packages/gatsby-plugin-sharp/src/index.js b/packages/gatsby-plugin-sharp/src/index.js index 36fadb06d23da..361e03bfc510b 100644 --- a/packages/gatsby-plugin-sharp/src/index.js +++ b/packages/gatsby-plugin-sharp/src/index.js @@ -274,7 +274,9 @@ async function generateBase64({ file, args = {}, reporter }) { }) let pipeline try { - pipeline = sharp(file.absolutePath) + pipeline = !options.failOnError + ? sharp(file.absolutePath, { failOnError: false }) + : sharp(file.absolutePath) if (!options.rotate) { pipeline.rotate()