Q: ERROR TypeError: Object(...) is not a function I have this error with angular-material in a mat-select tag. The option tag is a *ngFor list from a service. I get this error in the prod mode, but not in development mode.
ERROR TypeError: Object(...) is not a function ...
my package.json:
  "dependencies": {
    "@angular/animations": "^10.0.11",
    "@angular/common": "^10.0.11",
    "@angular/compiler": "^10.0.11",
    "@angular/cdk": "^10.1.3",
    "@angular/core": "^10.0.11",
    "@angular/flex-layout": "^10.0.0-beta.32",
    "@angular/forms": "^10.0.11",
    "@angular/google-maps": "^10.1.3",
    "@angular/localize": "^10.0.11",
    "@angular/material": "^10.1.3",
    "@angular/material-moment-adapter": "^10.1.3",
    "@angular/platform-browser": "^10.0.11",
    "@angular/platform-browser-dynamic": "^10.0.11",
    "@angular/router": "^10.0.11",
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1000.7",
    "@angular/cdk": "^10.1.3",
    ...


A: I resolved this issue by changing:
if (isArray(json)) {
      json = json.pop();
    }

with
if (Array.isArray(json)) {
      json = json.pop();
    }

Because isArray was a homemade class that crashed.
