Search code examples
angularruntime-errorglobalionic4angular8

Ionic 4 Angular 8 - Uncaught ReferenceError: global is not defined


M upgrading my ionic app from Ionic 3 to 4. But I got this error.

enter image description here

I know there are many solutions available in other forums. But they didn't work for me.

I tried (window as any).global = window; but it didn't work.

And I also tried to add Dragula. It didn't work either.

What i am missing? What should I do?


Solution

  • as @richardsengers answer

    https://github.com/aws-amplify/amplify-js/issues/678#issuecomment-389106098

    include this

    (window as any).global = window;
    

    In your polyfills.ts file