Aspnetcore-angular-universal: HMR - On hot module reload - I get duplicate entire pages showing.

Created on 19 Jul 2017  路  8Comments  路  Source: TrilonIO/aspnetcore-angular-universal

I think there is a bug in the main.browser.ts logic somehow.

Most helpful comment

If anyone is still unclear about this. This is what my main.browser.ts looks like now with the fix:

if (module['hot']) {
    module['hot'].accept();
    module['hot'].dispose(() => modulePromise.then((appModule) => appModule.destroy()));
} else {
    enableProdMode();
}

const modulePromise = platformBrowserDynamic().bootstrapModule(BrowserAppModule);

All 8 comments

I'm seeing exactly the same thing. After every hot module reload I see the old and the new content stack one above the other (old at the bottom). I have to refresh the page to clean up the mess.

Any suggestions?

Might be something that updated in a newer Angular I might need to patch the HMR for. Let me take a look

+1 also have same thing

I had the same issue, this is what worked for me: https://github.com/aspnet/JavaScriptServices/issues/665

aspnet/JavaScriptServices#665 fixed my issue as well.

Can anyone put in a PR to fix this issue for others?

If anyone is still unclear about this. This is what my main.browser.ts looks like now with the fix:

if (module['hot']) {
    module['hot'].accept();
    module['hot'].dispose(() => modulePromise.then((appModule) => appModule.destroy()));
} else {
    enableProdMode();
}

const modulePromise = platformBrowserDynamic().bootstrapModule(BrowserAppModule);

Was this page helpful?
0 / 5 - 0 ratings

Related issues

borgotecnologia picture borgotecnologia  路  15Comments

Gaulomatic picture Gaulomatic  路  26Comments

georgiosd picture georgiosd  路  26Comments

MaklaCof picture MaklaCof  路  21Comments

jrmcdona picture jrmcdona  路  20Comments