AzureAD / microsoft-authentication-library-for-js

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

Compilation error 'AADServerParamKeys' is not exported from '@azure/msal-common/browser' #7396

Closed BasSchoutenTribe closed 3 weeks ago

BasSchoutenTribe commented 3 weeks ago

Core Library

MSAL.js (@azure/msal-browser)

Core Library Version

3.26.1

Wrapper Library

Not Applicable

Wrapper Library Version

N/a

Public or Confidential Client?

Public

Description

I'm trying to use the msal-browser functionality im our project to have access to Graph in our Outlook addin When I add the package and try to use it by calling createNestablePublicClientApplication() I get a compile error

Using node 14.17.4

I cannot find any node requirements for this package

const pca = await createNestablePublicClientApplication({
            auth: {
                clientId: "...",
                authority: "https://login.microsoftonline.com/common"
            },
        });

Error Message

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

MSAL Logs

N/A

Network Trace (Preferrably Fiddler)

MSAL Configuration

N/A

Relevant Code Snippets

package.json:

  "dependencies": {
    ...
    "@azure/msal-browser": "^3.26.1"
    ...
import { createNestablePublicClientApplication } from '@azure/msal-browser';
...
const pca = await createNestablePublicClientApplication({
            auth: {
                clientId: "...",
                authority: "https://login.microsoftonline.com/common"
            },
        });

Reproduction Steps

N/A

Expected Behavior

No compile error

Identity Provider

Entra ID (formerly Azure AD) / MSA

Browsers Affected (Select all that apply)

Chrome

Regression

No response

BasSchoutenTribe commented 3 weeks ago

Also tried with Node 16 with same result

yilinsim commented 3 weeks ago

Also seeing a similar issue when attempting to upgrade @azure/msal-browser from v2 to v3.

Error message

.../node_modules/.pnpm/@azure+msal-browser@3.26.1/node_modules/@azure/msal-browser/dist/interaction_client/NativeInteractionClient.mjs
Can't import the named export 'AADServerParamKeys' from non EcmaScript module (only default export is available)

Node version: v20.14.0 Webpack version: v4.47.0 @azure/msal-browser version: v3.23.0 (using any newer version resulted in another typing issue)

What I tried:

Both attempts were unsuccessful. Not entirely sure if it's exactly the same issue but seems like it could be related.

konstantin-msft commented 3 weeks ago

@BasSchoutenTribe Can you please try building with node 18 or above? Older versions of node are not supported by MSAL.js v3.

BasSchoutenTribe commented 3 weeks ago

Sorry, but it is not possible on the short term to port our app to node18, too many dependencies that don't support that Is there a version of MSAL that does support node version < 18?

konstantin-msft commented 3 weeks ago

Please try LTS SDK: msal-browser@^2.39.0

BasSchoutenTribe commented 3 weeks ago

At least that compiles ...