Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AadHttpClient calls not working in IE 10, IE 11 #3562

Closed
1 of 4 tasks
srinivasnarula opened this issue Mar 8, 2019 · 7 comments
Closed
1 of 4 tasks

AadHttpClient calls not working in IE 10, IE 11 #3562

srinivasnarula opened this issue Mar 8, 2019 · 7 comments
Labels
area:spfx Category: SharePoint Framework (not extensions related) Needs: Triage 🔍 Awaiting categorization and initial review.

Comments

@srinivasnarula
Copy link

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

I'm using SPFx 1.7 version and should fetch data from azure ad authenticated web api using AadHttpClient and display in table format using Chrome and IE versions.

I followed every step mentioned in the below link in the context of webapp.
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aadhttpclient-enterpriseapi

Observed Behavior

SPFx webpart is able to fetch data properly in Chrome, but NOT in IE 11, IE 10 version.

I've attached one screen shot of the console log, which has error in sp-http-adal.js file.
ie-workbench issue

ie-workbench issue -1

Steps to Reproduce

Here is the code which I'm using to get the data

EndPoint : https://test.azurewebsites.net/api/v1/reports/getdata

  public getServerData(APIENDPOINT: string, ErrorMessage: string): Promise<ITest[]> {
    return new Promise<ITest[]>((resolve, reject) => {
      console.log('getServerData.......');
      this.aadHttpClientFactory
        .getClient(TEST_RESOURCE_ENDPOINT_URI)
        .then((aadHttpclient: AadHttpClient) => {
          const endpoint: string = `${TEST_ENDPOINT_URI + APIENDPOINT}`;
          console.log('endpoint...->'+endpoint);
          aadHttpclient.get(endpoint, AadHttpClient.configurations.v1,)
            .then((rawresponse: HttpClientResponse) => {
              if (rawresponse.status === 200) {
                console.table(rawresponse);
                return rawresponse.json();
              } else {
                throw new Error(`${ErrorMessage}`);
              }
            })
            .then((jsonResponse: ITest[]) => {
              console.log(jsonResponse);
              resolve(jsonResponse);
            })
            .catch((error) => {
              reject(error);
            });
        });
    });
  }

Please help me, if I need to alter my code or settings for the code to work with IE .

@msft-github-bot
Copy link
Collaborator

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@msft-github-bot msft-github-bot added the Needs: Triage 🔍 Awaiting categorization and initial review. label Mar 8, 2019
@SPFxDeveloper
Copy link

I have the same problem.

Please if anyone knows how to solve it please comment soon, thanks

@andrewconnell andrewconnell added the area:spfx Category: SharePoint Framework (not extensions related) label Mar 12, 2019
@srinivasnarula
Copy link
Author

srinivasnarula commented Mar 13, 2019

@SPFxDeveloper , @andrewconnell , @wobba

The issue is with console.table function. It was not allowing to process the success request as it is NOT supported in IE browsers. Thanks alot for your help.

 public getServerData(APIENDPOINT: string, ErrorMessage: string): Promise<ITest[]> {
    return new Promise<ITest[]>((resolve, reject) => {
      console.log('getServerData.......');
      this.aadHttpClientFactory
        .getClient(TEST_RESOURCE_ENDPOINT_URI)
        .then((aadHttpclient: AadHttpClient) => {
          const endpoint: string = `${TEST_ENDPOINT_URI + APIENDPOINT}`;
          console.log('endpoint...->'+endpoint);
          aadHttpclient.get(endpoint, AadHttpClient.configurations.v1,)
            .then((rawresponse: HttpClientResponse) => {
              if (rawresponse.status === 200) {
               //console.table(rawresponse); //console.table function doesn't support IE browsers.
                return rawresponse.json();
              } else {
                throw new Error(`${ErrorMessage}`);
              }
            })
            .then((jsonResponse: ITest[]) => {
              console.log(jsonResponse);
              resolve(jsonResponse);
            })
            .catch((error) => {
              reject(error);
            });
        });
    });
  }

As the issue is fixed. Closing the request.

@wobba
Copy link
Contributor

wobba commented Mar 14, 2019

@narulasrinivas console calls is basically a no-no with IE11 and should be avoided. Better to use SPFx or PnP logging.

@andrewconnell
Copy link
Collaborator

@wobba well... better to avoid IE11 ;)

@wobba
Copy link
Contributor

wobba commented Mar 14, 2019

@andrewconnell always - but unfortunately not something one can control usually :(

@msft-github-bot
Copy link
Collaborator

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) Needs: Triage 🔍 Awaiting categorization and initial review.
Projects
None yet
Development

No branches or pull requests

5 participants