gatsbyjs/gatsby · error
Invalid duotone option specified for ${file.absolutePath}, i
Error message
Invalid duotone option specified for ${file.absolutePath}, ignoring. Please pass an object to duotone with the keys "highlight" and "shadow" set to the corresponding hex values you want to use. What it means
Error "Invalid duotone option specified for ${file.absolutePath}, ignoring. Please pass an object to duotone with the keys "highlight" and "shadow" set to the corresponding hex values you want to use." thrown in gatsbyjs/gatsby.
Source
Thrown at packages/gatsby-plugin-sharp/src/image-data.ts:166
if (placeholder === `tracedSVG`) {
if (!didShowTraceSVGRemovalWarning) {
console.warn(
`"TRACED_SVG" placeholder argument value is no longer supported (used in gatsbyImageData processing), falling back to "DOMINANT_COLOR". See https://gatsby.dev/tracesvg-removal/`
)
didShowTraceSVGRemovalWarning = true
}
placeholder = `dominantColor`
}
const {
fit = `cover`,
cropFocus = sharp.strategy.attention,
duotone,
} = transformOptions
if (duotone && (!duotone.highlight || !duotone.shadow)) {
reporter.warn(
`Invalid duotone option specified for ${file.absolutePath}, ignoring. Please pass an object to duotone with the keys "highlight" and "shadow" set to the corresponding hex values you want to use.`
)
}
const metadata = await getImageMetadata(
file,
placeholder === `dominantColor`,
cache
)
if ((args.width || args.height) && layout === `fullWidth`) {
reporter.warn(
`Specifying fullWidth images will ignore the width and height arguments, you may want a constrained image instead. Otherwise, use the breakpoints argument.`
)
args.width = metadata?.width
args.height = undefined
}
View on GitHub (pinned to e85d62f177)
Solutions
- Pass duotone as an object with both keys set to hex colors: { highlight: "#hex", shadow: "#hex" }
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/gatsby-plugin-sharp/src/image-data.ts:166 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26).
Data as JSON: /api/errors/183027ceabed4a35.
Report an issue: GitHub.