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

Getting TypeError: eventTypes.includes is not a function #7377

Open
2 tasks
itsthamarai opened this issue Oct 14, 2024 · 0 comments
Open
2 tasks

Getting TypeError: eventTypes.includes is not a function #7377

itsthamarai opened this issue Oct 14, 2024 · 0 comments
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.

Comments

@itsthamarai
Copy link

itsthamarai commented Oct 14, 2024

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.0.2

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

2.0.2

Public or Confidential Client?

Public

Description

Hi Team - I have started seeing the error - TypeError: eventTypes.includes is not a function in the last few days in our test environments, though higher environments does not have this issue.

Error Message

TypeError: a.includes is not a function
at EventHandler.ts:99:36
at Map.forEach ()
at _c.emitEvent (EventHandler.ts:89:33)
at Il.initialize (StandardController.ts:341:27)
at Ol.initialize (PublicClientApplication.ts:95:32)
at index.js:85:6
at f (authentication.js:102:3)
at index.js:17:1
at index.js:158:7
at index.js:158:7

MSAL Logs

There are no MSAL logs in the console

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

export const msalConfig = {
    auth: {
        clientId: XXXXXXX,
        authority: `https://login.microsoftonline.com/XXXXXXX`,
        redirectUri: window.location.origin,
        knownAuthorities: ["login.microsoftonline.com"],
        navigateToLoginRequestUrl: true,
        postLogoutRedirectUri: window.location.origin,
    },
    cache: {
        cacheLocation: "sessionStorage", // This configures where your cache will be stored
        storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge
        secureCookies: true,
        cacheMigrationEnabled: true,
    },
    system: {	
        loggerOptions: {	
            loggerCallback: (level, message, containsPii) => {	
                if (containsPii) {		
                    return;		
                }		
                switch (level) {
                    case LogLevel.Error:
                        console.error(message);
                        return;
                    case LogLevel.Info:
                        console.info(message);
                        return;
                    case LogLevel.Verbose:
                        console.debug(message);
                        return;
                    case LogLevel.Warning:
                        console.warn(message);
                        return;
                    default:
                        return;
                }	
            }	
        }	
    }
};

Relevant Code Snippets

msalInstance
        .initialize()
        .then((res) => {
          // handle auth redirect/do all initial setup for msal
          msalInstance
            .handleRedirectPromise()
            .then((authResult) => {
              // redirect anonymous user to login page
              msalInstance.loginRedirect();
              const accounts = msalInstance.getAllAccounts();
              msalInstance.setActiveAccount(accounts[0]);
            })
            .catch((err) => {
              console.log(err);
            });
        })
        .catch((err) => {
          console.log(err);
        });

Reproduction Steps

I see a blank screen instead of the login screen when navigating to the app url

Expected Behavior

The login page should be displayed when there is no active account or The App Home page should be displayed when there is an active account.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox, Edge

Regression

"@azure/msal-browser": "3.0.2"

@itsthamarai itsthamarai 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 Oct 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Oct 14, 2024
@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 Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed A reported bug that needs to be investigated and confirmed msal-browser Related to msal-browser package msal-react Related to @azure/msal-react Needs: Attention 👋 Awaiting response from the MSAL.js team public-client Issues regarding PublicClientApplications question Customer is asking for a clarification, use case or information.
Projects
None yet
Development

No branches or pull requests

1 participant