Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Adding BrowserAnimationsModule causes hot module replacement failure #1165

Closed
@tonywr71

Description

@tonywr71

I have just attempted to add Angular Material design to an application. During the process, I was testing the counter.component.ts page, by changing the increment to 5 (this.currentCount+=5) and pressing Save. Hot module replacement kicked in, and the page reloaded, doubling up the content.

Counter
This is a simple example of an Angular 2 component.

Current count: 0

Counter
This is a simple example of an Angular 2 component.

Current count: 4

Just to make sure it wasn't me, I loaded up someone else's sample of adding material to the angular starter package from this site, and I have experienced the same thing. Go to this guys page: codeproject example, download his code, get it running (npm install, add @angular/cdk to the package.json and webpack vendors file, run webpack --config webpack.config.vendors.js, then run the application)

Next, go to the counter page, it should show the material button. Click on it a few times to watch the counter go up. Now, without stopping it, go into the counter.component.ts file and change the counter increment: this.currentCount+=25, then click Save. Behind the scenes, webpack will recompile and hot-module-replace, but when the content comes up, it's doubled up.

Any idea how to get HMR to work properly in this situation, or any workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions