Rxjs subscriptions do not work in IE 11 with Angular 10.1.1 and rxjs 6.6.3

Viewed 1325

After upgrading from Angular 10.0.1 to 10.1.1 IE 11 stopped working. Any try to subscribe (rxjs ^6.6.3) to even the simplest http request throws the error: "TypeError: Invalid calling object". Chrome works fine. Please help!

service.ts

test() {
    const apiHeader = new HttpHeaders()
        .set('Content-Type', 'application/json')
        .set('cache-control', 'no-cache');

    const url = decodeURIComponent(`https://.../api/test/test`);
    return this.http.get<any>(url);
}

app.component.ts

  ngOnInit() {
    this.myService.test()
      .pipe(take(1))
      .subscribe(data => {
        console.log('ngOnInit', data)

      },
        err => {
          console.log('err', err)
        });
  }

package.json

  "dependencies": {
    "@angular/animations": "~10.1.1",
    "@angular/cdk": "~10.2.0",
    "@angular/common": "~10.1.1",
    "@angular/compiler": "~10.1.1",
    "@angular/core": "^10.1.1",
    "@angular/forms": "10.1.1",
    "@angular/localize": "^10.1.1",
    "@angular/material": "^10.2.0",
    "@angular/material-moment-adapter": "^10.2.0",
    "@angular/platform-browser": "~10.1.1",
    "@angular/platform-browser-dynamic": "~10.1.1",
    "@angular/router": "~10.1.1",
    "classlist.js": "^1.1.20150312",
    "core-js": "^3.6.5",
    "rxjs": "~6.6.3",
    "tslib": "^2.0.1",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.11.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1001.0",
    "@angular/cli": "~10.1.0",
    "@angular/compiler-cli": "~10.1.1",
    "@types/node": "^14.10.0",
    "@types/jasmine": "~3.5.14",
    "@types/jasminewd2": "~2.0.8",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.2",
    "karma": "~5.2.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.3",
    "karma-jasmine": "~4.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "protractor": "~7.0.0",
    "ts-node": "~9.0.0",
    "tslint": "~6.1.3",
    "typescript": "~4.0.2"
  }

tsconfig.base.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es5",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

polyfills.ts

import 'core-js';
import 'classlist.js';
import 'web-animations-js';
import 'zone.js/dist/zone'; 

.browserslistrc

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
0 Answers
Related