Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'

我的梦境 提交于 2019-12-03 22:12:26
Mertcan Diken

Okey, I managed to find a way-out. zone.js guys recently released a new version you can check it from here. https://github.com/angular/zone.js/releases I think the problem is with this release. In your package.json use zone.js like this

"zone.js": "0.8.12"

If you're using the default Angular template in Plunker, you can set the zone.js version by inserting the versions into appropriate lines of the index.html file.

<script src="https://unpkg.com/zone.js@0.8.12/dist/zone.js"></script>
<script src="https://unpkg.com/zone.js@0.8.12/dist/long-stack-trace-zone.js"></script>

As mentioned in https://github.com/angular/zone.js/issues/832 the error happens only in zone.js version 0.8.13 and it is related to event binding.

The bug has been fixed already but for now in order to fix an application you need to downgrade to previous version of zone.js.

"zone.js": "0.8.12" in package.json should do the trick.

This error fired to me on plunker with lastest version Angular. I changed the index.html file to get version "0.8.12" (from unpkg.com/zone.js/dist/zone.js to unpkg.com/zone.js@0.8.12/dist/zone.js) and worked.

This happens when you are using cdn and zonejs have updated their path URL to differentiate versions.

So modify the path from

https://unpkg.com/zone.js/dist/....

To

https://unpkg.com/zone.js@0.8.12/dist/....

Refer change log here

Think I found something:

fixing "zone.js" to version "0.8.12" in the package.json solved the issue for me.

I am getting this issue with 'zone.js':"0.8.11"

Unhandled Promise rejection: Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask' ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'
    at Object.onScheduleTask (long-stack-trace-zone.js:115)
    at ZoneDelegate.scheduleTask (zone.js:404)
    at Object.onScheduleTask (zone.js:300)
    at ZoneDelegate.scheduleTask (zone.js:404)
    at Zone.scheduleTask (zone.js:235)
    at Zone.scheduleEventTask (zone.js:261)
    at zone.js:1561
    at BrowserPlatformLocation.onPopState (platform-browser.es5.js:1922)
    at PathLocationStrategy.onPopState (common.es5.js:592)
    at new Location (common.es5.js:256)
    at AppBrowserModuleInjector.createInternal (module.ngfactory.js [sm]:1)
    at AppBrowserModuleInjector.NgModuleInjector.create (core.es5.js:3558)
    at NgModuleFactory.create (core.es5.js:3531)
    at core.es5.js:4772
    at ZoneDelegate.invoke (zone.js:391)
    at Object.onInvoke (core.es5.js:4149)
    at ZoneDelegate.invoke (zone.js:390)
    at Zone.run (zone.js:141)
    at NgZone.run (core.es5.js:4017)
    at PlatformRef_._bootstrapModuleFactoryWithZone (core.es5.js:4770)
    at core.es5.js:4812
    at ZoneDelegate.invoke (zone.js:391)
    at Zone.run (zone.js:141)
    at zone.js:832
    at ZoneDelegate.invokeTask (zone.js:424)
    at Zone.runTask (zone.js:191)
    at drainMicroTaskQueue (zone.js:596) TypeError: Cannot create property '__creationTrace__' on string '__zone_symbol__optimizedZoneEventTask'
    at Object.onScheduleTask .........

I ran into this same problem last night and the following entry for zone.js in my package.json file worked for me:

"zone.js": "0.8.4"

This issue have been fixed in zone.js, please updated to the latest version of zone.js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!