1

Problem is I can see the data coming back in the request from browser, but it never reaches where I want it however the http get request fails and outputs the error I put below, I already enabled polyfills that are required, happy to provide if required here.

Error Browser IE11 has some serious problem with angular7 app i inherited,

HTML1300: Navigation occurred. localhost:4200 DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337 localhost:4200 Angular is running in the development mode. Call enableProdMode() to enable the production mode. TypeError: Object doesn't support this action    {
      [functions]: ,
      __proto__: {
         [functions]: ,
         __proto__: {
            [functions]: ,
            __proto__: { },
            message: "",
            name: "Error",
            Symbol(INITIAL_VALUE)_h.02cxvy0t1nq: undefined,
            Symbol(rxSubscriber)_g.02cxvy0t1nq: undefined
         },
         message: "",
         name: "TypeError",
         Symbol(INITIAL_VALUE)_h.02cxvy0t1nq: undefined,
         Symbol(rxSubscriber)_g.02cxvy0t1nq: undefined
      },
      description: "Object doesn't support this action",
      message: "Object doesn't support this action",
      name: "TypeError",
      number: -2146827843,
      stack: "TypeError: Object doesn't support this action    at Anonymous function (http://localhost:4200/main.js:7070:17)    at TapSubscriber.prototype._next (http://localhost:4200/vendor.js:123833:13)    at Subscriber.prototype.next (http://localhost:4200/vendor.js:115824:13)  at TapSubscriber.prototype._next (http://localhost:4200/vendor.js:123839:9)    at Subscriber.prototype.next (http://localhost:4200/vendor.js:115824:13)  at onLoad (http://localhost:4200/vendor.js:13397:21)    at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:8075:13)    at onInvokeTask (http://localhost:4200/vendor.js:58822:17)    at ZoneDelegate.prototype.invokeTask (http://localhost:4200/polyfills.js:8075:13)    at Zone.prototype.runTask (http://localhost:4200/polyfills.js:7848:21)",
      Symbol(INITIAL_VALUE)_h.02cxvy0t1nq: undefined,
      Symbol(rxSubscriber)_g.02cxvy0t1nq: undefined    }

Here's the piece of code where it starts having problem,

public myCompanyGet(observe?: 'body', reportProgress?: boolean): Observable<Array<myCompany>>;
public myCompanyGet(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<myCompany>>>;
public myCompanyGet(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<myCompany>>>;
public myCompanyGet(observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

    let headers = this.defaultHeaders;

    // authentication (oauth2) required
    if (this.configuration.accessToken) {
        let accessToken = typeof this.configuration.accessToken === 'function'
            ? this.configuration.accessToken()
            : this.configuration.accessToken;
        headers = headers.set('Authorization', 'Bearer ' + accessToken);
    }

    // to determine the Accept header
    let httpHeaderAccepts: string[] = [
        'application/json',
        'text/json',
        'application/xml',
        'text/xml'
    ];
    let httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
    if (httpHeaderAcceptSelected != undefined) {
        headers = headers.set("Accept", httpHeaderAcceptSelected);
    }

    // to determine the Content-Type header
    let consumes: string[] = [
    ];

    return this.httpClient.get<Array<myCompany>>(`${this.basePath}/api/myController/myMethod`,
        {
            withCredentials: this.configuration.withCredentials,
            headers: headers,
            observe: observe,
            reportProgress: reportProgress
        }
    ).pipe(
        catchError(error => {
            console.log(error)   // this is where I am getting error
        return null
        })

        );
}
Mathematics
  • 7,314
  • 25
  • 77
  • 152
  • does this issue happen only for IE11? – ABOS Feb 14 '19 at 15:55
  • perhaps https://stackoverflow.com/questions/35140718/angular-2-4-5-not-working-in-ie11 ? – ABOS Feb 14 '19 at 15:58
  • `catchError` has to return an Observable, so you have to return `return of(null)` instead of `return null`. Don't know if this has to do with your error though. – frido Feb 14 '19 at 16:47

0 Answers0