Search code examples
javascriptangularinternet-explorerbabel-polyfill

IE11 Object doesn't support property or method 'Symbol(Symbol.iterator)_a.2p3bca3ct9h


I am using Angular 8, tslint 5.15 & typescript v3

I am reading file as ArryaBuffer using below code

const reader = new FileReader();
    reader.readAsArrayBuffer(<FileObject>);
    reader.onload = () => {
      this.uploadedData= new Uint8Array(reader.result as ArrayBuffer);
    }

Now when i pass this uploadedData into API, I am converting into byteArray using below fucntion.

convertLicenseToByteArray(uploadedData) {
    const bytesArray = [];
    for (const i of uploadedData) {
      bytesArray.push(i);
    }
    return bytesArray;
  }

The above code is giving error in ie11,

ERROR TypeError: Object doesn't support property or method 'Symbol(Symbol.iterator)_a.srxqdvyfxlx'

I tried to search on net and found that may be i need to add babel-polyfill but it's not working for me.

Any help?


Solution

  • add 'core-js' into you package.json and add import into your polyfills.ts

    import 'core-js/es6/symbol';