AzureAD / microsoft-authentication-library-for-js

Microsoft Authentication Library (MSAL) for JS
http://aka.ms/aadv2
MIT License
3.61k stars 2.64k forks source link

AuthError is not defined #7242

Closed NaveenJamdagani closed 3 weeks ago

NaveenJamdagani commented 1 month ago

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.20.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

2.0.22

Public or Confidential Client?

Confidential

Description

I am getting this error saying "Uncaught (in promise) ReferenceError: AuthError is not defined". It was working fine yesterday. Work with npm start, but when serve build, not working.

Error Message

authErro

MSAL Logs

No response

Network Trace (Preferrably Fiddler)

MSAL Configuration

{
  auth: {
    clientId: "process.env.REACT_APP_MICROSOFT_CLIENT_ID"
  },
}

Relevant Code Snippets

NA

Reproduction Steps

  1. npm install.
  2. Build the react-app using npm run build
  3. serve the apps using serve -s build
  4. when accessing http://localhost:3000/ , its blank and showing the error on browser.

Expected Behavior

It should open the tool, currently page got blank with some console error related to Autherro.

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, Firefox

Regression

No response

Source

Internal (Microsoft)

kurroo10 commented 1 month ago

same here https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/7240

kurroo10 commented 1 month ago

can someone rise this ? my production is crashing now @jo-arroyo @tnorling ?

NaveenJamdagani commented 1 month ago

can someone rise this ? my production is crashing now @jo-arroyo @tnorling ?

You can try using old package-lock.json file and push that file to production. It will solve the issue for now.

ikrma47 commented 1 month ago

Hi I'm also facing the exact same error, It's happening all of the sudden and crashing my production to a blank page.

kurroo10 commented 1 month ago

can someone rise this ? my production is crashing now @jo-arroyo @tnorling ?

You can try using old package-lock.json file and push that file to production. It will solve the issue for now.

thank you, yes its working fine now.

Hi I'm also facing the exact same error, It's happening all of the sudden and crashing my production to a blank page.

try mine version, its working for me.

    "@azure/msal-browser": "3.10.0",
    "@azure/msal-react": "2.0.12",

note: for anyone facing this, dont forget to remove the caret (^) to avoid updating package before its fixed properly.

Gabriel-rd2 commented 1 month ago

I tried using this versions:

    "@azure/msal-browser": "3.10.0",
    "@azure/msal-react": "2.0.12",

but the error is still happening.

The weird thing is, i have a production build currently running without erros using these versions:

    "@azure/msal-browser": "^2.32.0",
    "@azure/msal-react": "^1.5.7",

But when i install them and run my build locally, i get the error.

tnorling commented 1 month ago

Can someone please share a minimal reproduction?

microsoft-github-policy-service[bot] commented 4 weeks ago

@NaveenJamdagani This issue has been automatically marked as stale because it is marked as requiring author feedback but has not had any activity for 5 days. If your issue has been resolved please let us know by closing the issue. If your issue has not been resolved please leave a comment to keep this open. It will be closed automatically in 7 days if it remains stale.