26

This is a bad thursday. It is the 13th. And yesterday I explained to my collegues how lucky we were about the 13th falling on a thursday, not on a friday.

Well, that was yesterday, and today I woke up with angular's fist in my face:

Cannot create property 'creationTrace' on string '__zone_symbol__optimizedZoneEventTask'

Well it might also be zone.js, or maybe even something else deeper down that dark abyss called development stack. Can anybody help me?

Sorry for my attitude, it's just that working with angular since its early alpha-stages has finally taken its toll on me.

PS: Suffice it to say, I did not change anything since the working version yesterday. So I am completely lost as to why and how and where this bug came from...

Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92

8 Answers8

47

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>
Joel Murphy
  • 845
  • 1
  • 6
  • 13
Mertcan Diken
  • 14,483
  • 2
  • 26
  • 33
  • 2
    And please mind that `"^0.8.12"` means "get the latest 0.8.*", `"~0.8.12"` means "get the latest". So in this case it's bare `"0.8.12"` to get this specific version and no other. – Filip Stachowiak Jul 17 '17 at 12:22
  • great answer, using plunker's angular template i just changed the index.html to replace ` ` with ` ` and it resolved the issue. – chumtoadafuq Jul 17 '17 at 16:54
8

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.

mikedanylov
  • 817
  • 11
  • 20
1

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.

Gilberto Alexandre
  • 2,227
  • 1
  • 18
  • 20
1

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

Aravind
  • 40,391
  • 16
  • 91
  • 110
0

Think I found something:

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

Tobias Gassmann
  • 11,399
  • 15
  • 58
  • 92
0

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 have tried with "zone.js" version "0.8.12" also it is not working for me :( – Narpat Shekhawat Jul 13 '17 at 12:02
  • This is an actual javascript error due to your mistake in most cases. Cannot create property .... on string if your app works fine before it then fixing the version will fix the problem but i guess there is another problem with your code. – Mertcan Diken Jul 13 '17 at 13:04
  • Yes i was using "Zone.js" : "^0.8.11" using this it was installed "0.8.13" now i am using zone.js : "0.8.11" it's working fine for me. – Narpat Shekhawat Jul 13 '17 at 13:17
0

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"

Carvel
  • 1
0

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

jiali passion
  • 1,691
  • 1
  • 14
  • 19