4

I have created project in Angular and added in SharePoint page using Content Editor.

It was worked correctly till yesterday. but it throwing below error while loading the page.

zone-evergreen.js:42 Uncaught Error: Zone already loaded.
    at zone-evergreen.js:42
    at Object.pDpN (zone-evergreen.js:635)
    at __webpack_require__ (bootstrap:79)
    at Module.hN/g (polyfills.ts:1)
    at __webpack_require__ (bootstrap:79)
    at Object.1 (polyfills.js?v=1.0:10)
    at __webpack_require__ (bootstrap:79)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at polyfills.js?v=1.0:1

main.ts:12 TypeError: Zone.assertZonePatched is not a function
    at new NgZone (core.js:28352)
    at getNgZone (core.js:29222)
    at PlatformRef.bootstrapModuleFactory (core.js:29104)
    at core.js:29162

Kindly check below screenshot for more details,enter image description here

Raj Gohel
  • 999
  • 7
  • 14

3 Answers3

6

To resolve this kindly add below script on your "Index.html"-

window.Zone = undefined

1

We have exactly the same issue at the moment since today with our production customers! We have added a script editor on top of the page with the same code

window.Zone = undefined;

But what is the impact on the exisiting applications?

Joey Lemmens
  • 111
  • 3
  • 9
1

Same here since today. We think Microsoft pushed an update to O365 causing this issues.

Indeed window.Zone = undefined solves this issue but we don't know yet if this impacts the rest of our applications... Still to investigate.

Nathan Swannet
  • 220
  • 3
  • 12
  • I have added code as following but isn't working. – Raj Gohel Mar 04 '21 at 08:11
  • Try adding a script editor on top of the page with that snippet. See if it works then. – Nathan Swannet Mar 04 '21 at 08:19
  • Did anybody report that issue to Microsoft yet? This may lead to following issues when we override SharePoint's Zone with Angular's Zone (https://angular.io/guide/zone), maybe with its Partial Page Rendering etc. – Benjamin Freitag Mar 05 '21 at 09:34
  • 1
    https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-online-angular-error-uncaught-error-zone-already/m-p/2184084 – Joey Lemmens Mar 05 '21 at 10:14