gatsbyjs/gatsby · error
[deprecated]
Error message
[deprecated]: ${deprecationReason} What it means
Generic deprecation guard in webpack-plugins: the webpack built-in/optimize plugin factory was created with a deprecationReason, so any use of that plugin prints the console.warn. The input at fault is the deprecated webpack plugin name used in the webpack config or internal plugin list.
Solutions
- Replace the deprecated webpack plugin with its modern webpack 5 equivalent
- Remove usage of the plugin if it is no longer needed
- Update Gatsby/plugin code that still wires up deprecated optimize plugins
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at packages/gatsby/src/utils/webpack-plugins.ts:12 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/bc5c2cad1e929be8.
Report an issue: GitHub.
Appendix: source
Thrown at packages/gatsby/src/utils/webpack-plugins.ts:12
import webpack, { WebpackPluginInstance } from "webpack"
const plugin =
(
name: string,
optimize?: boolean,
deprecationReason?: string
): ((...args: any) => WebpackPluginInstance) =>
(...args: any): WebpackPluginInstance => {
if (deprecationReason) {
// TODO add proper deprecation function to reporter
console.warn(`[deprecated]: ${deprecationReason}`)
}
const WebpackPlugin = (optimize ? webpack.optimize : webpack)[name]
return new WebpackPlugin(...args)
}
export const builtinPlugins = {
normalModuleReplacement: plugin(`NormalModuleReplacementPlugin`),
contextReplacement: plugin(`ContextReplacementPlugin`),
ignore: plugin(`IgnorePlugin`),
watchIgnore: plugin(`WatchIgnorePlugin`),
banner: plugin(`BannerPlugin`),
prefetch: plugin(`PrefetchPlugin`),
automaticPrefetch: plugin(`AutomaticPrefetchPlugin`),
define: plugin(`DefinePlugin`),
provide: plugin(`ProvidePlugin`),
hotModuleReplacement: plugin(`HotModuleReplacementPlugin`),
sourceMapDevTool: plugin(`SourceMapDevToolPlugin`),View on GitHub (pinned to e85d62f177)