{"record":{"id":"345692a2790c6065","repo":"angular/angular-cli","slug":"warning-outputhashing-option-is-disabled-when-u","errorCode":null,"errorMessage":"Warning: 'outputHashing' option is disabled when using the dev-server.","messagePattern":"Warning: 'outputHashing' option is disabled when using the dev-server\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular_devkit/build_angular/src/builders/dev-server/webpack-server.ts","lineNumber":96,"sourceCode":"  assertCompatibleAngularVersion(workspaceRoot);\n\n  async function setup(): Promise<{\n    browserOptions: BrowserBuilderSchema;\n    webpackConfig: webpack.Configuration;\n  }> {\n    if (options.hmr) {\n      logger.warn(tags.stripIndents`NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.\n      See https://webpack.js.org/guides/hot-module-replacement for information on working with HMR for Webpack.`);\n    }\n\n    // Get the browser configuration from the target name.\n    const rawBrowserOptions = await context.getTargetOptions(options.buildTarget);\n\n    if (rawBrowserOptions.outputHashing && rawBrowserOptions.outputHashing !== OutputHashing.None) {\n      // Disable output hashing for dev build as this can cause memory leaks\n      // See: https://github.com/webpack/webpack-dev-server/issues/377#issuecomment-241258405\n      rawBrowserOptions.outputHashing = OutputHashing.None;\n      logger.warn(`Warning: 'outputHashing' option is disabled when using the dev-server.`);\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    const browserOptions = (await context.validateOptions(\n      {\n        ...rawBrowserOptions,\n        watch: options.watch,\n        verbose: options.verbose,\n        // In dev server we should not have budgets because of extra libs such as socks-js\n        budgets: undefined,\n      } as json.JsonObject & BrowserBuilderSchema,\n      builderName,\n    )) as json.JsonObject & BrowserBuilderSchema;\n\n    const { styles, scripts } = normalizeOptimization(browserOptions.optimization);\n    if (scripts || styles.minify) {\n      logger.error(tags.stripIndents`\n        ****************************************************************************************","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/dev-server/webpack-server.ts#L78-L114","documentation":"When the browser build target specifies `outputHashing` other than `none`, the webpack dev-server forcibly resets it to `none` and warns. Output hashing is disabled for dev builds because hashed filenames accumulating in memory can cause memory leaks in webpack-dev-server. The warning tells you your configured option was overridden.","triggerScenarios":"`ng serve` where the buildTarget (e.g. the browser build configuration) sets `\"outputHashing\": \"all\"` (or media/bundles); also happens when serving with the production configuration, which defaults outputHashing to all.","commonSituations":"Running `ng serve -c production` to debug prod-like behavior, or a shared configuration block that applies outputHashing to both build and serve targets.","solutions":["Serve with a development configuration that does not set outputHashing (or sets it to \"none\")","If you need prod-like behavior, run `ng build` instead of serve for hashed outputs","Override outputHashing in a serve-specific configuration: `\"configurations\": { \"production-serve\": { \"outputHashing\": \"none\" } }`","Ignore the warning if the override is acceptable; the build still works"],"exampleFix":"// before\nng serve --configuration production\n// after (angular.json)\n\"configurations\": { \"prod-serve\": { \"outputHashing\": \"none\" } }\n// ng serve --configuration prod-serve","handlingStrategy":"validation","validationCode":"// detect outputHashing in the serve buildTarget before ng serve\nconst buildOpts = getTargetOptions(serveOptions.buildTarget);\nif (buildOpts.outputHashing && buildOpts.outputHashing !== 'none') {\n  console.warn('outputHashing will be disabled by the dev-server; remove it or serve with a dev configuration.');\n}","typeGuard":"function hashesWillBeDisabled(o: { outputHashing?: 'none'|'media'|'bundles'|'all' }): boolean {\n  return !!o?.outputHashing && o.outputHashing !== 'none';\n}","tryCatchPattern":null,"preventionTips":["Never serve with the production configuration; build instead","Keep outputHashing in build-only configurations","Create serve-specific configurations when prod-like settings are needed","Remember the dev-server forcibly resets outputHashing to none"],"tags":["output-hashing","webpack","dev-server","configuration-override"],"backgroundTag":"output-hashing-disabled-in-dev-server","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}