{"record":{"id":"bc5c2cad1e929be8","repo":"gatsbyjs/gatsby","slug":"deprecated-deprecationreason","errorCode":null,"errorMessage":"[deprecated]: ${deprecationReason}","messagePattern":"\\[deprecated\\]: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/utils/webpack-plugins.ts","lineNumber":12,"sourceCode":"import webpack, { WebpackPluginInstance } from \"webpack\"\n\nconst plugin =\n  (\n    name: string,\n    optimize?: boolean,\n    deprecationReason?: string\n  ): ((...args: any) => WebpackPluginInstance) =>\n  (...args: any): WebpackPluginInstance => {\n    if (deprecationReason) {\n      // TODO add proper deprecation function to reporter\n      console.warn(`[deprecated]: ${deprecationReason}`)\n    }\n\n    const WebpackPlugin = (optimize ? webpack.optimize : webpack)[name]\n    return new WebpackPlugin(...args)\n  }\n\nexport const builtinPlugins = {\n  normalModuleReplacement: plugin(`NormalModuleReplacementPlugin`),\n  contextReplacement: plugin(`ContextReplacementPlugin`),\n  ignore: plugin(`IgnorePlugin`),\n  watchIgnore: plugin(`WatchIgnorePlugin`),\n  banner: plugin(`BannerPlugin`),\n  prefetch: plugin(`PrefetchPlugin`),\n  automaticPrefetch: plugin(`AutomaticPrefetchPlugin`),\n  define: plugin(`DefinePlugin`),\n  provide: plugin(`ProvidePlugin`),\n  hotModuleReplacement: plugin(`HotModuleReplacementPlugin`),\n  sourceMapDevTool: plugin(`SourceMapDevToolPlugin`),","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/utils/webpack-plugins.ts#L1-L30","documentation":"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.","triggerScenarios":"Thrown at packages/gatsby/src/utils/webpack-plugins.ts:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"fallback","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-14T00:17:10.932Z"}