microsoft-authentication-library-for-js: Cannot find module '@azure/msal-common' and '@azure/msal-angular' or its corresponding type declarations.

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.0.0-alpha.0

Wrapper Library

MSAL Angular (@azure/msal-angular)

Wrapper Library Version

3.0.0-alpha.0

Public or Confidential Client?

Public

Description

import { MsalService } from '@azure/msal-angular';
                            ^^^^^^^^^^^^^^^^^^
import { AuthenticationResult, InteractionRequiredAuthError } from '@azure/msal-common';
                                                                   ^^^^^^^^^^^^^^^^^^^^
                                                                                                           

we can not import the MsalService from @azure/msal-angular. we noticed this error few hours ago. we are using angular 16.

we also tried following versions. and its same for all those versions.

    "@azure/msal-angular": "^3.0.0",
    "@azure/msal-browser": "^3.0.0",
 "@azure/msal-angular": "^3.0.0-alpha.2",
 "@azure/msal-browser": "^3.0.0-alpha.2"
 "@azure/msal-angular": "^3.0.0-beta.1",
 "@azure/msal-browser": "^3.0.0-beta.1"

Error Message

Cannot find module ‘@azure/msal-angular’ or its corresponding type declarations.

Msal Logs

MSAL Configuration

{
auth: {
        clientId: clientId,
        authority: "B2C_1A_SIGNUP_SIGNIN",
        redirectUri: '/',
        navigateToLoginRequestUrl: false
    },
    cache: {
        cacheLocation: "LocalStoarage",
        storeAuthStateInCookie: false
    }
}

Relevant Code Snippets

import { MsalService } from '@azure/msal-angular';
import { AuthenticationResult, InteractionRequiredAuthError } from '@azure/msal-common';

Reproduction Steps

  1. npm i @azure/msal-browser
  2. npm i @azure/msal-angular
  3. import { MsalService } from ‘@azure/msal-angular’; to the service.
  4. import { AuthenticationResult, InteractionRequiredAuthError } from ‘@azure/msal-common’;

Expected Behavior

Should be able to use MsalService from '@azure/msal-angular'

Identity Provider

Azure B2C Custom Policy

Browsers Affected (Select all that apply)

None (Server)

Regression

No response

Source

External (Customer)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 17
  • Comments: 26

Most upvoted comments

@HansakaSS Thanks for raising this issue. There has been an error in our release process and we are currently working on a fix. Thank you all for your patience.

It’s broken, do not use version ^3.0.0 right now, this fix the issue for now: “@azure/msal-angular”: “3.0.0-beta.1”, “@azure/msal-browser”: “3.0.0-beta.1”,

This is really pathetic. It’s feb 2024, and the error is still there.

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

The current workaround for this issue is using the beta version for msal browser: “@azure/msal-browser”: “3.0.0-beta.1”, “@azure/msal-common”: “^14.5.0”, “@azure/msal-react”: “2.0.8”,

Can confirm that the bug in react version is still there

"@azure/msal-browser": "3.0.1",
"@azure/msal-react": "2.0.1",

another issue is that source-map-loader shows the warning message, we need to ignore the warning message by the following workaround. fix: ignore webpack warnings by source-map-loader #11752

@tnorling Yes it is indeed still a problem. The contents of node_modules@azure/msal-angular only consist of LICENSE, readme.md and package.json.

    "@azure/msal-angular": "3.0.0-alpha.0",
    "@azure/msal-browser": "3.0.0-alpha.0",
    ```
    we updated the packages like this and installed the `npm i @azure/msal-common` seems to get rid of the error.