I think there is a bug in the main.browser.ts logic somehow.
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);
It should be fixed now via https://github.com/MarkPieszak/aspnetcore-angular2-universal/commit/a83a6a9bef283c39845467457dd50358b007c6f8 changes. @pjmagee
Most helpful comment
If anyone is still unclear about this. This is what my main.browser.ts looks like now with the fix: