1

I was trying to implement Microsoft Active Directory authentication in simple Angular application following the instruction: Tutorial: Sign in users and call the Microsoft Graph API (...)

When using loginPopUp() or loginRedirect() methods from MsalService (@azure/msal-angular) I am getting error about performanceMeasurement.startMeasurement:

core.mjs:9171 ERROR TypeError: performanceMeasurement.startMeasurement is not a function
    at PerformanceClient.startMeasurement (PerformanceClient.js:76:32)
    at BrowserPerformanceClient.startMeasurement (BrowserPerformanceClient.js:43:65)
    at ClientApplication.acquireTokenPopup (ClientApplication.js:274:57)
    at PublicClientApplication.loginPopup (PublicClientApplication.js:78:21)
    at MsalService.loginPopup (azure-msal-angular.js:55:35)
    at AppComponent.login (app.component.ts:25:23)
    at AppComponent_button_16_Template_button_click_0_listener (app.component.html:33:24)
    at executeListenerWithErrorHandling (core.mjs:15679:16)
    at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15714:22)
    at HTMLButtonElement.<anonymous> (platform-browser.mjs:459:38)

Im using:

 "@azure/msal-angular": "^2.5.2",
 "@azure/msal-browser": "^2.32.2",
 (...)
 "@angular-devkit/build-angular": "14.2.10",
 "@angular/cli": "14.2.10",

I found out that similar issue for @azure/msal-react could be solved with downgrading the packages, but it didn't work in my case (or I haven't found the right versions :D)

PabloK
  • 11
  • 2
  • Downgrade helped me, at least for now. It works with: "@azure/msal-angular": "^2.5.2", "@azure/msal-browser": "^2.30.0" (For angular: 14.2.10) – PabloK Jan 19 '23 at 08:59

1 Answers1

0

We have also faced the same issue, we removed "^" from the version number, the below is what we did and it worked. The latest msal version is having some breaking changes it seems. Old Code: "@azure/msal-angular": "^2.3.0", "@azure/msal-browser": "^2.24.0",

New Code: "@azure/msal-angular": "2.3.0", "@azure/msal-browser": "2.24.0"