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

Attempted import error: 'AccountEntity' is not exported from '@azure/msal-common'. #7331

Open
1 of 2 tasks
Camiloadh99 opened this issue Sep 23, 2024 · 1 comment
Open
1 of 2 tasks
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

@Camiloadh99
Copy link

Camiloadh99 commented Sep 23, 2024

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.24.0

Wrapper Library

MSAL React (@azure/msal-react)

Wrapper Library Version

2.1.0

Public or Confidential Client?

Public

Description

I have a React app (with create react app) with the following versions installed:

 "dependencies": {
    "@azure/msal-browser": "3.22.0",
    "@azure/msal-react": "2.0.22",
    "react": "17.0.2",
    "typescript": "4.4.3",
  },

It turns out that when importing the PublicClientApplication object the application tells me "Attempted import error: 'AccountEntity' is not exported from '@azure/msal-common'" i try to use differents versions but it's the same.

import "./App.scss";
import { Provider } from "react-redux";
import "bootstrap/dist/css/bootstrap.css";
import { STORE as store, PERSISTOR } from "./store/redux";
import { PersistGate } from "redux-persist/integration/react";
import MainComponent from "./MainComponent";
import "./constants/global.css";
import "./components/pages/styles/Mainpage.css";
import "./constants/responsive.css";
import "./constants/variables.css";
import { setInterceptors } from "./frameworks_and_drivers/Axios";
import { SnackbarProvider } from "notistack";
import { FilterContextProvider } from "./context";
import { Configuration, PublicClientApplication } from "@azure/msal-browser";

setInterceptors();

// MSAL configuration
const configuration: Configuration = {
  auth: {
    clientId: "clientID",
    authority: "authority",
    redirectUri: "redirectUri",
  },
};

const pca = new PublicClientApplication(configuration);

console.log(pca);
function App() {
  return (
    <Provider store={store}>
      <PersistGate persistor={PERSISTOR}>
        <SnackbarProvider maxSnack={3}>
          <FilterContextProvider>
            <MainComponent />
          </FilterContextProvider>
        </SnackbarProvider>
      </PersistGate>
    </Provider>
  );
}
export default App;

Error Message

./node_modules/@azure/msal-browser/dist/index.mjs
Attempted import error: 'AccountEntity' is not exported from '@azure/msal-common'.

MSAL Logs

i can't get it because the const msalInstance = new PublicClientApplication(msalConfig);it self is not working

Network Trace (Preferrably Fiddler)

  • Sent
  • Pending

MSAL Configuration

{
  auth: {
    clientId: "clientID",
    authority: "authority",
    redirectUri: "redirectUri",
  },
}

Relevant Code Snippets

All appears on app or main index files when import and use a new instance for PublicClientApplication

Reproduction Steps

  1. Create react app
  2. install @azure/msal-browser and @azure/msal-react
  3. Make a new instance for PublicClientApplication
  4. Then the error apprears

Expected Behavior

when i make a new instance for PublicClientApplication i can follow with the configuration of the MsalProvider on msal for react putting the msal config

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome, None (Server)

Regression

No response

Source

External (Customer)

@Camiloadh99 Camiloadh99 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 Sep 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Sep 23, 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 Sep 23, 2024
@LRR1993
Copy link

LRR1993 commented Oct 21, 2024

any update on this, or a version combination that can be used instead ?

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

2 participants