performanceMeasurement.startMeasurement error when using @azure-msal-angular for Microsoft AD authentication

Pawel Klosko 15 Reputation points
2023-01-18T15:59:16.7866667+00:00

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",

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

4 answers

Sort by: Most helpful
  1. Cayle Bray 10 Reputation points
    2023-01-19T17:32:58.2266667+00:00

    Hi All:

    I resolved this by setting the msal-common version to 9.0.2, previously it was set to 9.1.0.

    Everything is working correctly now.

    2 people found this answer helpful.
    0 comments No comments

  2. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2023-01-20T20:57:01.9133333+00:00

    Hi all, the solution to this is to downgrade the current msal-common version to 9.0.2. Something is wrong with the most current version, so please do this as a workaround until there's a fix. Please let me know if you have any questions.

    If this answer is correct please mark it as "Verified" so other users can reference it.

    Thank you,

    James

    1 person found this answer helpful.
    0 comments No comments

  3. Ganeshraj Kandasamy 1 Reputation point
    2023-01-19T10:16:48.03+00:00

    Hi James, I'm also getting the exact error


  4. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2023-03-02T23:42:54.8066667+00:00

    @Pawel Klosko , have you seen this thread? Please let me know if it helps at all. If not I can help you further.

    Best,

    James

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.