angular: [BUG] IE11 -> Can't execute code from a freed script
Context:
- angular 5.0.0-rc3
- zone.js 0.8.18
- IE 11
I tried to update from zone 0.8.4 (current official angular 5 tutorials version) to 0.8.18, and get at some point with IE 11 the following error: Can't execute code from a freed script. This is a really imprecise error, that I didn’t manage to find the origin but is due for sure from zone.js.
EDIT: after testing => appear from 0.8.12 (working) to 0.8.13 (no more working on IE 11)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 20
- Comments: 39 (13 by maintainers)
Commits related to this issue
- Add the IE fix for "Can't execute code from a freed script". See angular/zone.js#933. — committed to kevinkuszyk/angular-ie-freed-script-error by kevinkuszyk 6 years ago
I seem to get this error in IE11 while dev tools are open, regardless of whether or not JiaLiPassion’s fix is applied. Closing dev tools makes the web app load again… gotta love IE
@ganeshkbhat, @falcoprescher , could you guys try to add
in index.html before loading
zone.js?@shcallaway , oh, sorry, please modify it to
Thanks so much @JiaLiPassion
Added only for IE and Edge using the below in pollyfills.ts and it works a charm
@lifaon74 , glad to help, and
__Zone_enable_cross_context_checkthis flag will enable some additional error check toIE, inIE, sometimesDeveloperToolswill also registereventListenerswhich will cause some weird exceptions.I took the example from https://github.com/mgechev/angular-seed , and updated to angular 5 and zone.js 0.8.18. I added you code and this worked ! Do you have detailed informations of what does this module (https://github.com/angular/zone.js/blob/master/MODULE.md) ? And idea why does it works on chrome but not on IE ?
Thanks to you.
EDIT 1 : the error is in zone.js inside
checkIEAndCrossContextat line 2747 EDIT 2 : the bug is sometimes hard to reproduce as it does not append everytimeSame Issue here
@jochenhebbrecht , yes, everything will work if you set it to
true. enable theflagwill cause an additionaltry/catchandtoStringoperation when you calladdEventListener. so it will be a littleperformance impactwhen you calladdEventListener, the behavior is the same.And the reason don’t want to set it to
trueby default even in IE because it only impact some of thedeveloper tools, so it only impactdevelopmentmode, and in the new version ofangular/cligeneratedproject, you can find the following code insrc/polyfills.ts.you can open the comment when you in development mode and comment it when you want to build in production mode.
@fuerst, @ciesielskico, you can just add the following line in
polyfill.tsbefore loadingzone.js.