Userbase + Angular.io

Two things to do to make Userbase work in Angular.

Add the snippet below to your index.html:

  <!-- https://github.com/aws/aws-amplify/issues/678 fix: -->
  <script>
    if (global === undefined) {
      var global = window;
    }
  </script>
  <!-- https://github.com/aws/aws-amplify/issues/678 fix end-->

Add this to polyfill.ts:

global.Buffer = global.Buffer || require('buffer').Buffer;

after installing buffer:

npm install buffer --save

References:

Back to bits

Comments