{"record":{"id":"ddb8d1ea74185697","repo":"angular/angular-cli","slug":"notice-hot-module-replacement-hmr-is-enabled-fo","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/angular_devkit/build_angular/src/builders/dev-server/webpack-server.ts","lineNumber":85,"sourceCode":"  options: NormalizedDevServerOptions,\n  builderName: string,\n  context: BuilderContext,\n  transforms: {\n    webpackConfiguration?: ExecutionTransformer<webpack.Configuration>;\n    logging?: WebpackLoggingCallback;\n    indexHtml?: IndexHtmlTransform;\n  } = {},\n): Observable<DevServerBuilderOutput> {\n  // Check Angular version.\n  const { logger, workspaceRoot } = context;\n  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,","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/build_angular/src/builders/dev-server/webpack-server.ts#L67-L103","documentation":"An informational notice logged when the `hmr` option is enabled for the webpack dev-server. HMR swaps modules in the browser without a full reload; because it can produce surprising state behavior, Angular prints a notice pointing to webpack's HMR guide. It is purely informational, not a failure.","triggerScenarios":"Running `ng serve --hmr` or setting `\"hmr\": true` in the dev-server target options; logged at the start of `setup()` before the browser configuration is resolved.","commonSituations":"Developers enabling HMR for faster UI iteration; often combined with `--live-reload=false`; sometimes left in angular.json after an experiment and later noticed in logs.","solutions":["If HMR is wanted, keep the flag and use the linked webpack HMR guide to handle module acceptance correctly","Remove `--hmr` or set `\"hmr\": false` to return to standard live-reload behavior","If the notice is unexpected, check angular.json serve options and CI scripts for a leftover hmr flag","Combine with `\"liveReload\": false` only if you understand components will not fully reload on failure"],"exampleFix":"// before (angular.json serve options)\n\"options\": { \"hmr\": true }\n// after\n\"options\": { \"hmr\": false }","handlingStrategy":"validation","validationCode":"// angular.json serve options check\nif (serveOptions.hmr === true) {\n  console.log('HMR enabled: expect module-swap notices; see webpack HMR guide.');\n}","typeGuard":"function isHmrEnabled(o: { hmr?: boolean }): boolean {\n  return o?.hmr === true;\n}","tryCatchPattern":null,"preventionTips":["Enable hmr only in local development configurations","Review serve options after upgrading Angular so experimental flags do not linger","Pair hmr with liveReload:false deliberately, not accidentally","Familiarize the team with webpack HMR acceptance semantics before enabling"],"tags":["hmr","hot-module-replacement","webpack","dev-server","notice"],"backgroundTag":"hmr-enabled-notice","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}