[email protected] or @azure/[email protected]@azure/[email protected]@azure/[email protected]@azure/[email protected][email protected] with [email protected]
When including the @azure/msal-browser in the project, the following error appears:
TypeScript error in D:/project_name/node_modules/@azure/msal-browser/dist/src/index.d.ts(5,1):
Declaration or statement expected. TS1128
3 | export { BrowserAuthError, BrowserAuthErrorMessage } from "./error/BrowserAuthError";
4 | export { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage } from "./error/BrowserConfigurationAuthError";
> 5 | export type { AuthCallback } from "./types/AuthCallback";
| ^
6 | export { AuthenticationParameters, TokenExchangeParameters, AuthResponse, TokenResponse, InteractionRequiredAuthError, AuthError, AuthErrorMessage, INetworkModule, Logger, LogLevel } from "@azure/msal-common";
No.
Don't know.
Please provide your MSAL configuration options.
// Provide configuration values here.
// For Azure B2C issues, please include your policies.
When export type { AuthCallback } from './types/AuthCallback' is changed to export { AuthCallback } from './types/AuthCallback' it is compiling successfully.
Could be related to my tsconfig
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
Is this issue browser-specific? If so, please detail which browsers are impacted (e.g. IE 11, Safari).''
No.
@ninio Could you try upgrading to Typescript 3.8? This version introduced type-only imports and exports which is why you may be seeing the above error.
The update fixes this.
Thanks!
Solved me issue, you may want to add this to the documentation on getting started. I am upgrading a project that was using older version of TypeScript and was hitting this error.
Most helpful comment
@ninio Could you try upgrading to Typescript 3.8? This version introduced type-only imports and exports which is why you may be seeing the above error.