AzureAD / microsoft-authentication-library-for-js

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

Compilation error at node_modules/@azure/msal-react/index.d.ts #3121

Closed fan-boy closed 3 years ago

fan-boy commented 3 years ago

Library

Framework

Description

Added image in next comment.

Error Message

Build time error in node_modules/@azure/msal-react/dist/index.d.ts(5,1) Declaration or statement expected.

MSAL Configuration

// Provide configuration values here.
{
auth: {
    clientId: AzureActiveDirectoryAppClientId,
    authority: b2cPolicies.authorities.signUpSignIn.authority,
    knownAuthorities: [b2cPolicies.authorityDomain,b2cPolicies.authorities.forgotPassword.authority],
    redirectUri: "http://localhost:3000/auth", window.location.origin
    postLogoutRedirectUri: "/", 
    navigateToLoginRequestUrl: true,

  },
  cache: {
    cacheLocation: "sessionStorage",
    storeAuthStateInCookie: false,
  },
  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;
        }
      },
    },
  },
}

// For Azure B2C issues, please include your policies.
names: {
        signUpSignIn: "b2c_1_susi",
        forgotPassword: "b2c_1_reset",
        editProfile: "b2c_1_edit_profile"
    },

Reproduction steps

import * from "@azure/msal-react" in any file

Expected behavior

No compile time error

Identity Provider

Browsers/Environment

Regression

Security

Source

fan-boy commented 3 years ago

image (1)

tnorling commented 3 years ago

@fan-boy I'm not able to reproduce this. Can you check your typescript environment? Are you able to reproduce this using our Typescript sample?

fan-boy commented 3 years ago

I upgraded my typescript to 4.0.5 from 3.7.5 . Works fine now. Thanks for your help :)