🐞 bug report
Affected Package
The issue is caused by package zone.js
Is this a regression?
Yes, the previous version in which this bug was not present was: Angular 10
Description
After updating Angular to version 11 and using the latest zone.js (0.11.3), on ng test the ngOnDestroy handler crashes throwing:
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'data-ck-expando' of undefined
TypeError: Cannot read property 'data-ck-expando' of undefined
It is because Object.prototype.toString.call( undefined ) returns [Object Window] instead of [Object Undefined] when the strict mode isn't turned on.
A similar issue was already reporter in the past: #31678
The workaround is to import zone.js in polyfills.js like this import 'zone.js/dist/zone.js' instead of import 'zone.js/dist/zone' or import 'zone.js'
🌍 Your Environment
@angular-devkit/architect 0.1100.4
@angular-devkit/build-angular 0.1100.4
@angular-devkit/core 11.0.4
@angular-devkit/schematics 11.0.4
@schematics/angular 11.0.4
@schematics/update 0.1100.4
ng-packagr 11.0.3
rxjs 6.6.3
typescript 4.0.3
webpack 4.44.2
🐞 bug report
Affected Package
The issue is caused by package zone.js
Is this a regression?
Yes, the previous version in which this bug was not present was: Angular 10
Description
After updating Angular to version 11 and using the latest zone.js (0.11.3), on
ng testthe ngOnDestroy handler crashes throwing:It is because
Object.prototype.toString.call( undefined )returns[Object Window]instead of[Object Undefined]when the strict mode isn't turned on.A similar issue was already reporter in the past: #31678
The workaround is to import zone.js in
polyfills.jslike thisimport 'zone.js/dist/zone.js'instead ofimport 'zone.js/dist/zone'orimport 'zone.js'🌍 Your Environment