PatrickJS / angular-hmr

:fire: Angular Hot Module Replacement for Hot Module Reloading
https://patrickjs.com
Apache License 2.0
505 stars 46 forks source link

Compatibility changes for Angular 11 #89

Closed samhinshaw closed 2 years ago

samhinshaw commented 3 years ago

It appears that Angular 11 has some breaking changes with HMR. This causes an error to be thrown when .destroy() is called in angular-hmr here. It appears that the error is originating from angular/core here. I am not sure about the cause of the change, but my guess is that Angular is now calling the destroy method itself, before angular-hmr would.

Simply removing this call (as suggested in this PR) appears to fix the issue, and HMR appears to be working fine. I have proposed a version bump, as I would guess that this change is breaking for versions of Angular <11.

Unknowns:

AliYusuf95 commented 3 years ago

The destroy is called from angular hmr plugin:

https://github.com/angular/angular-cli/blob/c2b7260f7976ecfa2409fa4195d37f6f465b0da9/packages/angular_devkit/build_angular/src/webpack/plugins/hmr/hmr-accept.ts#L81