-
Notifications
You must be signed in to change notification settings - Fork 701
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
You must call and await the initialize function before attempting to call any other MSAL API #918
Comments
I'm also having this error/issue. Not sure what's going on, the app behaves all the way through the authentication step(s), but when returning back to the app, prior to calling for chats, get the error reported above. Have tried in incognito/inprivate, still the same |
me too ! BrowserAuthError.ts:351 Uncaught (in promise) BrowserAuthError: uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors |
I'm getting the same error when I start the app! |
Little more information from the logs. I'm not sure what's going on here - not a REACT programmer so I can't really tell where it's failing, but it looks like it's not setting the token in localstorage, but then expecting to find it there. This is on localhost, testing with a properly configured frontend/backend app (I know that works, it will go through the flow, just not complete once it returns back to the client).
|
I'm getting the same error when configuring AzureAD authentication. But if you want to work without AzureAD, you can remove the frontend and authentication configuration from appsettings.development.json. You can work with guest user. |
Hello fixed this problem with the below code in webapp\src\index.tsx file. Reference links: |
@kbrkrgz10 感谢分享解决了我的问题,以下是我修改后的源码 import React from 'react'; if (!localStorage.getItem('debug')) { let container: HTMLElement | null = null; document.addEventListener('DOMContentLoaded', () => {
}); export function renderApp() {
} |
fixed it on my end using the code from @kbrkrgz10 above, thank you so much! |
I still get this error in the last code I got from main and even adding what recommended by @kbrkrgz10 does not fixed it for me |
That has been fixed by #969 |
ERROR
uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors
BrowserAuthError: uninitialized_public_client_application: You must call and await the initialize function before attempting to call any other MSAL API. For more visit: aka.ms/msaljs/browser-errors
at createBrowserAuthError (http://localhost:3000/static/js/bundle.js:190000:10)
at blockAPICallsBeforeInitialize (http://localhost:3000/static/js/bundle.js:194490:94)
at StandardController.handleRedirectPromise (http://localhost:3000/static/js/bundle.js:188079:92)
at PublicClientApplication.handleRedirectPromise (http://localhost:3000/static/js/bundle.js:185227:28)
at http://localhost:3000/static/js/bundle.js:14614:27
The text was updated successfully, but these errors were encountered: