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

performanceMeasurement.startMeasurement is not a function Error in Type script sample #5587

Closed
rnphani opened this issue Jan 18, 2023 · 21 comments
Assignees
Labels
bug A problem that needs to be fixed for the feature to function as intended. msal-browser Related to msal-browser package msal-common Related to msal-common package public-client Issues regarding PublicClientApplications

Comments

@rnphani
Copy link

rnphani commented Jan 18, 2023

Core Library

MSAL.js v2 (@azure/msal-browser)

Core Library Version

1.4.9

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

1.4.9

Public or Confidential Client?

Public

Description

Getting issue with type script sample path for sample download :microsoft-authentication-library-for-js-dev\samples\msal-react-samples\typescript-sample, cloud not able to proceed further with type script sample , dont know how to fix this error

Error Message

error details Uncaught TypeError: performanceMeasurement.startMeasurement is not a function
at PerformanceClient.startMeasurement (PerformanceClient.ts:123:1)
at BrowserPerformanceClient.startMeasurement (BrowserPerformanceClient.ts:46:1)
at ClientApplication.acquireTokenPopup (ClientApplication.ts:328:1)
at PublicClientApplication.loginPopup (PublicClientApplication.ts:84:1)
at handleLogin (SignInButton.tsx:18:1)
at onClick (SignInButton.tsx:47:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1)
Please let me know how to fix this issue as soon as possible

Msal Logs

n/a

MSAL Configuration

auth: {
        clientId: "clientId",
        authority: "https://login.windows-ppe.net/common",
        redirectUri: "",
        postLogoutRedirectUri: "/"
    }

Relevant Code Snippets

n/a

Reproduction Steps

n/a

Expected Behavior

n/a

Identity Provider

Azure AD / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

@azure/msal-browser": "^2.30.0"

Source

Internal (Microsoft)

@rnphani rnphani added bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Jan 18, 2023
@ghost ghost added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jan 18, 2023
@github-actions github-actions bot added msal-browser Related to msal-browser package msal-react Related to @azure/msal-react public-client Issues regarding PublicClientApplications labels Jan 18, 2023
@ghost ghost assigned jo-arroyo Jan 18, 2023
@ysagar-drreddys
Copy link

Facing the same issue. Kindly let us know when can this be fixed or any other workarounds.

@NickAusloos
Copy link

NickAusloos commented Jan 18, 2023

Having the same issue with my Angular app (@azure/msal-browser": "^2.28.0)

TypeError: c.startMeasurement is not a function
    at n.startMeasurement (main.170c67012d4545f5.js:1:1231498)
    at t.startMeasurement (main.170c67012d4545f5.js:1:1436828)
    at t.<anonymous> (main.170c67012d4545f5.js:1:1369813)
    at f (main.170c67012d4545f5.js:1:379297)
    at Object.next (main.170c67012d4545f5.js:1:379402)
    at main.170c67012d4545f5.js:1:378337
    at new E (polyfills.17058541d81afe21.js:1:18860)
    at _n (main.170c67012d4545f5.js:1:378072)
    at t.getDiscoveredAuthority (main.170c67012d4545f5.js:1:1369584)
    at t.<anonymous> (main.170c67012d4545f5.js:1:1368368)

@pascalgross
Copy link

Just updated my angular app and got the same problem.
File header of PerformanceClient.js says: /*! @azure/msal-common v9.1.0 2023-01-18 */

@ISvirko
Copy link

ISvirko commented Jan 18, 2023

is there going to be any fix for this? or a workaround?

@Nic-Nitro5
Copy link

Nic-Nitro5 commented Jan 18, 2023

Should we roll back a version here? We have: a.startMeasurement is not a function

@NKFahrni
Copy link

image
Found this here: #5582

@georgiosApo
Copy link

Can confirm that this is happening to our latest deploys as well. We're using:

"@azure/msal-browser": "^2.32.2",
"@azure/msal-react": "^1.5.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",

And getting the following issue:

TypeError: performanceMeasurement.startMeasurement is not a function
    at PerformanceClient2.startMeasurement (PerformanceClient.ts:123:32)
    at BrowserPerformanceClient2.startMeasurement (BrowserPerformanceClient.ts:46:55)
    at RedirectClient2.<anonymous> (StandardInteractionClient.ts:205:65)
    at step (_tslib.js:87:23)
    at Object.next (_tslib.js:68:53)
    at _tslib.js:61:71
    at new Promise (<anonymous>)
    at __awaiter (_tslib.js:57:12)
    at StandardInteractionClient2.getDiscoveredAuthority (StandardInteractionClient.ts:203:115)
    at RedirectClient2.<anonymous> (StandardInteractionClient.ts:142:48)

Thing to note is the number 2 added to the names of PerformanceClient2, BrowserPerformanceClient2 etc.
Any idea what can be causing that or is it intended?

Any pointers or workarounds would be much appreciated!

Thanks a lot in advance!

// G

@Nic-Nitro5
Copy link

Nic-Nitro5 commented Jan 18, 2023

"@azure/msal-browser": "2.30.0", "@azure/msal-react": "^1.5.2"

We did a rollback and app is running fine.

@Cowraider
Copy link

Cowraider commented Jan 18, 2023

For Angular I used those two versions to make it work again:
"@azure/msal-angular": "^2.5.2" and "@azure/msal-browser": "^2.32.1"
The bug seems to be in msal-browser version 2.32.2 if I am not mistaken

@ivaanortega
Copy link

In React we did a rollback in "@azure/msal-common": "9.1.0" to "@azure/msal-common": "9.0.2" and it works like a charm.
The msal-browser we use : "@azure/msal-browser": "2.32.2"

@kotacode
Copy link

In React we did a rollback in "@azure/msal-common": "9.1.0" to "@azure/msal-common": "9.0.2" and it works like a charm. The msal-browser we use : "@azure/msal-browser": "2.32.2"

Thank you! Been banging my head against the wall 😅

@georgiosApo
Copy link

The issue was really caused by us using the non explicit versioning for msal-browser. 2.32.2 seems to be the culprit so using 2.32.1 with "@azure/msal-react": "^1.5.2".

Just remember to use explicit versioning and target version "@azure/msal-browser": "2.32.1" WITHOUT the "^" symbol in conjunction with the version number.

Most likely the cause that is making this issue emerge.
The faulty MSAL version gets released, pipeline runs, faulty version gets deployed and the issue occurs.

Thanks for all the help in this thread!

@mohd7469
Copy link

@jo-arroyo it seems you updated PerformanceClient but it didn't fixed yet please confirm

@pascalgross
Copy link

@jo-arroyo whats the status on this issue?
Obviously broken and still unconfirmed?

@kotacode
Copy link

kotacode commented Jan 19, 2023

@jo-arroyo it seems you updated PerformanceClient but it didn't fixed yet please confirm

@jo-arroyo whats the status on this issue? Obviously broken and still unconfirmed?

Doesn't look like the PR has been merged yet if you look at #5589. Looks like code reviews are still being performed.

@mohd7469
Copy link

For now this is the temporary solution until they proper fix. Just use it without ^ carret.

"@azure/msal-angular": "2.5.2",
"@azure/msal-browser": "2.32.1"

@rafi007akhtar
Copy link

rafi007akhtar commented Jan 19, 2023

For me, the following versions worked in Angular.

"@azure/msal-angular": "2.5.1",
"@azure/msal-browser": "2.32.1",

@jo-arroyo jo-arroyo added msal-common Related to msal-common package bug A problem that needs to be fixed for the feature to function as intended. and removed msal-react Related to @azure/msal-react bug-unconfirmed A reported bug that needs to be investigated and confirmed question Customer is asking for a clarification, use case or information. labels Jan 19, 2023
@ghost ghost removed the Needs: Attention 👋 Awaiting response from the MSAL.js team label Jan 19, 2023
@jo-arroyo
Copy link
Collaborator

Hi all, yes this is a confirmed bug that we are working on fixing. Please downgrade until the next release is available.

@pascalgross @mohd7469 @kotacode

@timtucker-dte
Copy link

First a breaking defect in the App Insights SDK and then this...

Were all the Azure JS testers part of the layoffs this week?

@jo-arroyo
Copy link
Collaborator

Thank you all for your patience. Msal-common v 9.1.1 has been released. Please upgrade and let us know if you continue to see issues.

@jo-arroyo
Copy link
Collaborator

Closing as msal-common v9.1.1 release addresses these issues. Please open a new issue if you continue to see errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem that needs to be fixed for the feature to function as intended. msal-browser Related to msal-browser package msal-common Related to msal-common package public-client Issues regarding PublicClientApplications
Projects
None yet
Development

No branches or pull requests