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

TS1205 Re-exporting in /src/authentication/azureTokenCredentials/index.ts:7:10 #1535

Open
5 of 6 tasks
PassionPenguin opened this issue Nov 16, 2023 · 4 comments · May be fixed by #1661
Open
5 of 6 tasks

TS1205 Re-exporting in /src/authentication/azureTokenCredentials/index.ts:7:10 #1535

PassionPenguin opened this issue Nov 16, 2023 · 4 comments · May be fixed by #1661

Comments

@PassionPenguin
Copy link

Bug Report

Prerequisites

  • Can you reproduce the problem?
  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.

Description

/src/authentication/azureTokenCredentials/index.ts:7:10

Console Errors: no

Screenshots:

Screenshot 2023-11-16 at 10 56 10 PM

Steps to Reproduce

import {Client, ClientOptions} from "@microsoft/microsoft-graph-client";
import {
    TokenCredentialAuthenticationProvider
} from "@microsoft/microsoft-graph-client/src/authentication/azureTokenCredentials";
import {ClientSecretCredential} from "@azure/identity";

export class MSGraphClient {
    public static client: Client;

    public static init() {
        const tenantID = process.env.MSGRAPH_TENANT_ID,
            clientID = process.env.MSGRAPH_CLIENT_ID,
            clientSecret = process.env.MSGRAPH_CLIENT_SECRET;
        let clientOptions: ClientOptions = {
            authProvider: new TokenCredentialAuthenticationProvider(
                new ClientSecretCredential(tenantID, clientID, clientSecret),
                {scopes: ["https://graph.microsoft.com/.default"]}
            ),
        };
        MSGraphClient.client = Client.initWithMiddleware(clientOptions);
    }
}

Expected behavior: no throw

Actual behavior: throw:

./node_modules/@microsoft/microsoft-graph-client/src/authentication/azureTokenCredentials/index.ts:7:10
Type error: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.
  5 |  * -------------------------------------------------------------------------------------------
  6 |  */
> 7 | export { TokenCredentialAuthenticationProviderOptions } from "./ITokenCredentialAuthenticationProviderOptions";
    |          ^
  8 | export { TokenCredentialAuthenticationProvider } from "./TokenCredentialAuthenticationProvider";
  9 |
Error: Command "npm run build" exited with 1

Additional Context

running both on vercel and locally throws

Usage Information

Request ID - N/A

SDK Version - [SDK version you are using]

  • Node (Check, if using Node version of SDK)

Node Version - 21.1.0

  • Browser any

Browser Name - [The name of Browser that you are using for SDK]

Version - [The version of the browser you are using]

@PassionPenguin
Copy link
Author

npm run build

==>

hoarfroster@HF hfrecipe % npm run build 
npm run build

> hello-next@1.0.0 build
> next build

   ▲ Next.js 14.0.2
   - Environments: .env.local

 ✓ Creating an optimized production build    
 ✓ Compiled successfully
   Linting and checking validity of types  ...
   We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default.
   The following mandatory changes were made to your tsconfig.json:

        - isolatedModules was set to true (requirement for SWC / Babel)

   Linting and checking validity of types  ..Failed to compile.

./node_modules/@microsoft/microsoft-graph-client/src/authentication/azureTokenCredentials/index.ts:7:10
Type error: Re-exporting a type when 'isolatedModules' is enabled requires using 'export type'.

  5 |  * -------------------------------------------------------------------------------------------
  6 |  */
> 7 | export { TokenCredentialAuthenticationProviderOptions } from "./ITokenCredentialAuthenticationProviderOptions";
    |          ^
  8 | export { TokenCredentialAuthenticationProvider } from "./TokenCredentialAuthenticationProvider";
  9 |

@mehonja
Copy link

mehonja commented Apr 1, 2024

i know im bumping old issues but this still persists and renders large parts of the application unsuable

@kurtcodebain
Copy link

I had the same issue. I fixed it by adding index to the import, like this:
import {TokenCredentialAuthenticationProvider} from '@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials/index';

@mehonja
Copy link

mehonja commented Apr 14, 2024

I had the same issue. I fixed it by adding index to the import, like this: import {TokenCredentialAuthenticationProvider} from '@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials/index';

i have submitted an PR and its still in review, but i also made my quick wrapper for it since i only needed the sendMail functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants