Skip to content

HMR Story Update for 6rc2 #10268

@cwilsn

Description

@cwilsn

Versions

Angular CLI: 6.0.0-rc.2
Node: 9.11.1
OS: darwin x64
Angular: 6.0.0-rc.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 6.0.0-rc.2
@angular-devkit/architect: 0.5.4
@angular-devkit/build-angular: 0.5.4
@angular-devkit/build-optimizer: 0.5.4
@angular-devkit/core: 0.5.4
@angular-devkit/schematics: 0.5.4
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 6.0.0-rc.2.4
@schematics/angular: 0.5.4
@schematics/update: 0.5.4
typescript: 2.7.2
webpack: 4.5.0

Repro steps

Changes needed?

Run script

"scripts": {
  ...
  "hmr": "ng serve --hmr -e=hmr"
}

becomes

"scripts": {
  ...
  "hmr": "ng serve --hmr"
}

angular.json

"environmentSource": "environments/environment.ts",
"environments": {
  "dev": "environments/environment.ts",
  "hmr": "environments/environment.hmr.ts",
  "prod": "environments/environment.prod.ts"
},

becomes

"configurations": {
  "hmr": {
    "fileReplacements": [
      {
        "src": "src/environments/environment.ts",
        "replaceWith": "src/environments/environment.hmr.ts"
      }
    ]
  },
  "production": {
  ...

After making the above changes, the app will be served but I get an console error with the following

dev-server.js:60 Uncaught Error: [HMR] Hot Module Replacement is disabled.
    at Object../node_modules/webpack/hot/dev-server.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentseverity5: regression

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions