I have built an ionic angular app it's getting build but once deployed in S3 getting issue

I have built an angular ionic app. I have build the code through ionic build --prod command and once deployed in S3 bucket I am getting an issue in console as Uncaught TypeError: Cannot read property ‘0’ of undefined main-es2015.76405d09ff6e059ed868.js:1.
I have built a web app not android app.
And not using cordova.

Audit your code carefully for anyplace where you are treating JavaScript identifiers (such as property and class names) as strings:

getar(propname: string): string[] {
  return this[propname];

first(propname: string): string {
  return this.getar(propname)[0]; // this will break under minification
if (getCurrentPage().name === "MyPage") // also a production mode time bomb

It is also possible that you have a race condition. Audit all asynchronous code to make sure you can prove that everything is definitively set before you try to access it.