Skip to main content

Angular and Zone.js

The following error message indicates that PhotoEditorSDK was loaded with the included polyfills in an Angular environment:

  • Zone.js has detected that ZoneAwarePromise '(window|global).Promise' has been overwritten.

Angular will require a specific order in which the polyfills are loaded and PhotoEditorSDK provides an extra entrypoint for this case.

- import { PhotoEditorSDK } from 'photoeditorsdk'
+ import { PhotoEditorSDK } from 'photoeditorsdk/no-polyfills'

If you want to support Internet Explorer 11 you have to include the following polyfills in your polyfills.ts before import 'zone.js/dist/zone';:

// Polyfills Promise, fetch, Object.assign, Symbol, Set, Map
import 'react-app-polyfill/ie11';
// Loads core-js/stable, regenerator-runtime
import 'react-app-polyfill/stable';
import 'core-js/features/array/find';
import 'core-js/features/array/map';

Add the following snippet to the polyfills.ts if you encounter this error message process is not defined:

(window as any).process = {
env: { DEBUG: undefined },