SPFX WebPart consuming Graph api to display events is not working in IE11

%3CLINGO-SUB%20id%3D%22lingo-sub-1157823%22%20slang%3D%22en-US%22%3ESPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1157823%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20have%20created%20SPFX%20Webpart%20which%20displays%20calendar%20events%20using%20Graph%20API.%20It%20is%20working%20in%20Chrome%20but%20not%20in%20IE11%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIm%20getting%26nbsp%3B%20error%20(in%20the%20attachment)%20in%20IE11%20when%20trying%20to%20display%20upcoming%20events%20using%20Graph%20API%20in%20my%20spfx%20webpart%3A%3CBR%20%2F%3ESPFX%20Version%3A%201.9.1%3CBR%20%2F%3Eim%20getting%20response%20null%20in%20IE11%20but%20its%20working%20in%20chrome%20or%20Edge%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1157939%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1157939%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F531319%22%20target%3D%22_blank%22%3E%40avinash1239%3C%2FA%3E%26nbsp%3Ba%20null%20or%20undefined%20check%20at%20the%20specific%20error%20line%20should%20resolve%20the%20error.%20The%20browsers%20must%20be%20behaving%20differently%20with%20a%20specific%20object%20that%20you%20have.%3C%2FP%3E%3CP%3EAlternatively%2C%20if%20this%20related%20to%20a%20browser%20feature%2C%20check%20if%20you%20need%20to%20include%20a%20polyfill%20to%20make%20it%20compatible%20with%20IE.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1162637%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1162637%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9907%22%20target%3D%22_blank%22%3E%40Joel%20Rodrigues%3C%2FA%3E%26nbsp%3BI%20have%20done%20that%20%2C%20I%20am%20getting%20the%20same%20error.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1163101%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1163101%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F531319%22%20target%3D%22_blank%22%3E%40avinash1239%3C%2FA%3E%26nbsp%3Bcan%20you%20share%20the%20error%20details%2C%20not%20just%20the%20message%2C%20and%20also%20the%20line%20of%20code%20where%20that%20is%20happening%20(if%20it%20doesn't%20contain%20anything%20confidential)%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1166845%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1166845%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9907%22%20target%3D%22_blank%22%3E%40Joel%20Rodrigues%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Evar%20currentDate%20%3D%20'end%2FDatetime%20ge%202020-02-11T00%3A00%3A00.000'%3C%2FP%3E%3CDIV%3E%3CDIV%3E%26nbsp%3B%3CSPAN%3Emsgraphclient%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Eapi%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E'%2Fme%2Fcalendar%2Fevents'%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Eversion%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22v1.0%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Efilter%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EcurrentDate%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Eorderby%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E%22start%2FdateTime%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%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3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Evalue%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3Econsole%3C%2FSPAN%3E%3CSPAN%3E.%3C%2FSPAN%3E%3CSPAN%3Elog%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EcalendarEvents%3C%2FSPAN%3E%3CSPAN%3E)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EIf%20I%20remove%20the%20filter%20condition%20%2Cits%20working%20fine%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1167523%22%20slang%3D%22en-US%22%3ERe%3A%20SPFX%20WebPart%20consuming%20Graph%20api%20to%20display%20events%20is%20not%20working%20in%20IE11%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1167523%22%20slang%3D%22en-US%22%3EJust%20to%20validate%2C%20do%20other%20requests%20to%20graph%20from%20your%20code%20work%20from%20IE%3F%3CBR%20%2F%3EIs%20the%20eventsResponse%20object%20exactly%20the%20same%20(same%20properties)%20when%20executing%20from%20IE%20and%20a%20different%20browser%3F%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20doesn't%20seem%20to%3C%2FLINGO-BODY%3E
Occasional Contributor

I have created SPFX Webpart which displays calendar events using Graph API. It is working in Chrome but not in IE11

 

Im getting  error (in the attachment) in IE11 when trying to display upcoming events using Graph API in my spfx webpart:
SPFX Version: 1.9.1
im getting response null in IE11 but its working in chrome or Edge

5 Replies

@avinash1239 a null or undefined check at the specific error line should resolve the error. The browsers must be behaving differently with a specific object that you have.

Alternatively, if this related to a browser feature, check if you need to include a polyfill to make it compatible with IE.

@Joel Rodrigues I have done that , I am getting the same error.

@avinash1239 can you share the error details, not just the message, and also the line of code where that is happening (if it doesn't contain anything confidential)?

@Joel Rodrigues 

var currentDate = 'end/Datetime ge 2020-02-11T00:00:00.000'

 msgraphclient.api('/me/calendar/events'
     .version("v1.0")   
   .filter(currentDate
     .orderby("start/dateTime")
     .top(3)
     .get( (error:any,eventsResponse:any,rawResponse?:any)=>{
          const calendarEvents:MicrosoftGraph.Event[]=eventsResponse.value;
          console.log(calendarEvents);
   
    });
 
If I remove the filter condition ,its working fine
Just to validate, do other requests to graph from your code work from IE?
Is the eventsResponse object exactly the same (same properties) when executing from IE and a different browser?

It doesn't seem to