msgraph-sdk-javascript: Angular app does not work on IE11 after installing microsoft-graph-client package
Bug Report
Prerequisites
- Can you reproduce the problem? Yes
- Are you running the latest version?
Yes
- Are you reporting to the correct repository? Yes
- Did you perform a cursory search?
Yes
For more information, see the
CONTRIBUTING
guide.
Description
[Description of the bug or feature] Angular App Version : 7.1.3
Not working on IE11, please find the below error.
Added Polyfills for IE and Targeted to ES5
Console Errors: [Is there any console error]
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
- [First Step]
- [Second Step]
- [and so on…]
Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Additional context
Add any other context about the problem here…
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (9 by maintainers)
I had the same issue. According to the docs:
import { Client } from "@microsoft/microsoft-graph-client";
is meant for the node environmentand
const Client = MicrosoftGraph.Client;
is meant for browser usecases.This doesn’t help if you want to use npm and types provided by “@microsoft/microsoft-graph-client” in a typescript build for browsers and not a script tag.
After some experimentation I found the answer:
import { Client, ImplicitMSALAuthenticationProvider, MSALAuthenticationProviderOptions } from "@microsoft/microsoft-graph-client/lib/src/browser";
This solved the IE11 issues for my usecase. I am unsure if this is the intended way of importing the browser sdk, but it works.