Closed ddbradshaw closed 8 years ago
So, it is important to implement the hmr lifecycle hooks in the app module. Specifically, the following is required in the AppModule:
hmrOnDestroy(store)
I had left this out because I wasn't trying to maintain state, overlooking the fact that the createNewHosts method is called within this destroy method. CreateNewHosts creates a new psuedo app element prior to the deletion of the old app element.
For the life of I can't figure out why this is happening. Making a change to a component or css triggers the hot reload as expected, but during the reload lifecycle, my index.html app element is deleted from the body.
Component:
HTML Before reload:
HTML After reload:
This causes the following error to be thrown: