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

Stricter tsconfig.json options generate tsc errors in @clerk/backend-core #326

Closed
5 of 13 tasks
mkitt opened this issue Aug 5, 2022 · 6 comments · Fixed by #343
Closed
5 of 13 tasks

Stricter tsconfig.json options generate tsc errors in @clerk/backend-core #326

mkitt opened this issue Aug 5, 2022 · 6 comments · Fixed by #343
Assignees
Labels

Comments

@mkitt
Copy link

mkitt commented Aug 5, 2022

Package + Version

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/clerk-expo
  • @clerk/backend-core
  • @clerk/clerk-sdk-node
  • @clerk/edge
  • other:

Version:

@clerk/remix: 0.5.13
@clerk/remix: 1.1.0

Browser/OS

GitHub Actions — ubuntu-latest, macOS locally in development

Description

Following the setup instructions from the "Getting started" section in the clerkinc/remix-auth-starter repository and adding the following stricter settings to the tsconfig.json file:

    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "skipLibCheck": true,

Then run:

npx tsc

This will produce a number of errors originating from:

node_modules/@clerk/backend-core/

It seems like we should be able to apply these stricter options in our application's tsconfig.json without it leaking into the Clerk library to produce these errors? I haven't seen this in other libraries our application consumes with these same options applied. The only workaround I've found is to remove these options to match the standards set by the Clerk library.

The addition of skipLibCheck is the workaround from #155 which also feels like an option we also shouldn't have to supply in the tsconfig.json.

Related or Similar:

🙌 Thanks in advance and let me know if I can provide any other information.

@nikosdouvlis
Copy link
Member

Hello @mkitt, many thanks for the detailed description :)

The latest clerk-sdk-node release improves how we handle internal dependencies. Please see this related comment in #155 for more details and please let me know if you hit any other issues so I can help.

@nikosdouvlis
Copy link
Member

Closing this one, but please feel free to ping us again if its needed :)

@mkitt
Copy link
Author

mkitt commented Sep 6, 2022

Sorry for the delayed response but I'm still seeing errors reported from node_modules/@clerk/backend-core following the above use case.

@nikosdouvlis
Copy link
Member

No worries, thanks for reporting back! It'd be great if you could share a snippet containing the reported errors as I'm not able to reproduce this one anymore locally using the tsconfig you provided.

In the meantime, setting skipLibCheck to true should be an acceptable workaround as these (mostly internal) errors shouldn't affect any of the public Clerk methods.

@mkitt
Copy link
Author

mkitt commented Sep 6, 2022

Here's the error output from npx tsc...

node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:20:37 - error TS4111: Property 'CLERK_API_KEY' comes from an index signature, so it must be accessed with ['CLERK_API_KEY'].

20 const DEFAULT_API_KEY = process.env.CLERK_API_KEY || '';
                                       ~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:21:37 - error TS4111: Property 'CLERK_API_URL' comes from an index signature, so it must be accessed with ['CLERK_API_URL'].

21 const DEFAULT_API_URL = process.env.CLERK_API_URL || 'https://api.clerk.dev';
                                       ~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:22:41 - error TS4111: Property 'CLERK_API_VERSION' comes from an index signature, so it must be accessed with ['CLERK_API_VERSION'].

22 const DEFAULT_API_VERSION = process.env.CLERK_API_VERSION || 'v1';
                                           ~~~~~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/api/endpoints/OrganizationApi.ts:79:51 - error TS2379: Argument of type '{ method: "GET"; path: string; queryParams: GetOrganizationListParams | undefined; }' is not assignable to parameter of type 'APIRequestOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Type '{ method: "GET"; path: string; queryParams: GetOrganizationListParams | undefined; }' is not assignable to type '{ method: "GET" | "POST" | "PATCH" | "DELETE" | "PUT"; queryParams?: Record<string, unknown>; headerParams?: Record<string, unknown>; bodyParams?: object; } & { url?: string; path: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
    Type '{ method: "GET"; path: string; queryParams: GetOrganizationListParams | undefined; }' is not assignable to type '{ method: "GET" | "POST" | "PATCH" | "DELETE" | "PUT"; queryParams?: Record<string, unknown>; headerParams?: Record<string, unknown>; bodyParams?: object; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
      Types of property 'queryParams' are incompatible.
        Type 'GetOrganizationListParams | undefined' is not assignable to type 'Record<string, unknown>'.
          Type 'undefined' is not assignable to type 'Record<string, unknown>'.

 79     return this.APIClient.request<Organization[]>({
                                                      ~
 80       method: 'GET',
    ~~~~~~~~~~~~~~~~~~~~
... 
 82       queryParams: params,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
 83     });
    ~~~~~

node_modules/@clerk/backend-core/src/api/endpoints/SessionApi.ts:15:44 - error TS2379: Argument of type '{ method: "GET"; path: string; queryParams: QueryParams | undefined; }' is not assignable to parameter of type 'APIRequestOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Type '{ method: "GET"; path: string; queryParams: QueryParams | undefined; }' is not assignable to type '{ method: "GET" | "POST" | "PATCH" | "DELETE" | "PUT"; queryParams?: Record<string, unknown>; headerParams?: Record<string, unknown>; bodyParams?: object; } & { url?: string; path: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
    Type '{ method: "GET"; path: string; queryParams: QueryParams | undefined; }' is not assignable to type '{ method: "GET" | "POST" | "PATCH" | "DELETE" | "PUT"; queryParams?: Record<string, unknown>; headerParams?: Record<string, unknown>; bodyParams?: object; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
      Types of property 'queryParams' are incompatible.
        Type 'QueryParams | undefined' is not assignable to type 'Record<string, unknown>'.
          Type 'undefined' is not assignable to type 'Record<string, unknown>'.

 15     this.APIClient.request<Array<Session>>({
                                               ~
 16       method: 'GET',
    ~~~~~~~~~~~~~~~~~~~~
... 
 18       queryParams: queryParams,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 19     });
    ~~~~~

node_modules/@clerk/backend-core/src/api/errors/Errors.ts:12:5 - error TS2375: Type '{ paramName: string | undefined; sessionId: string | undefined; }' is not assignable to type '{ paramName?: string; sessionId?: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'paramName' are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

12     meta: {
       ~~~~

  node_modules/@clerk/types/dist/api.d.ts:8:5
    8     meta?: {
          ~~~~
    The expected type comes from property 'meta' which is declared here on type 'ClerkAPIError'

node_modules/@clerk/backend-core/src/api/errors/Errors.ts:23:3 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Error'.

23   message: string;
     ~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:20:36 - error TS4111: Property 'CLERK_API_KEY' comes from an index signature, so it must be accessed with ['CLERK_API_KEY'].

20 export const API_KEY = process.env.CLERK_API_KEY || '';
                                      ~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:49:5 - error TS2412: Type 'LoadCryptoKeyFunction | undefined' is not assignable to type 'LoadCryptoKeyFunction' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the type of the target.
  Type 'undefined' is not assignable to type 'LoadCryptoKeyFunction'.

49     this.loadCryptoKeyFunction = loadCryptoKeyFunction;
       ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:82:69 - error TS4111: Property 'CLERK_JWT_KEY' comes from an index signature, so it must be accessed with ['CLERK_JWT_KEY'].

82       availableKey = await this.loadCryptoKey(jwtKey || process.env.CLERK_JWT_KEY);
                                                                       ~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:140:57 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

140     const header = JSON.parse(this.decodeBase64Function(rawHeader));
                                                            ~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:141:58 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

141     const payload = JSON.parse(this.decodeBase64Function(rawPayload));
                                                             ~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:142:49 - error TS2532: Object is possibly 'undefined'.

142     const signature = this.decodeBase64Function(rawSignature.replace(/_/g, '/').replace(/-/g, '+'));
                                                    ~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:154:29 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.

154     const signature = parse(rawSignature);
                                ~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:196:56 - error TS2379: Argument of type '{ jwtKey: string | undefined; authorizedParties: string[] | undefined; fetchInterstitial: () => Promise<string>; tokenType: "header"; }' is not assignable to parameter of type 'BuildAuthenticatedStateOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'jwtKey' are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

196       return this.buildAuthenticatedState(headerToken, {
                                                           ~
197         jwtKey,
    ~~~~~~~~~~~~~~~
... 
200         tokenType: 'header',
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201       });
    ~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:218:24 - error TS2379: Argument of type '{ originURL: URL; host: string; forwardedHost: string | null | undefined; forwardedPort: string | null | undefined; forwardedProto: string | null | undefined; }' is not assignable to parameter of type '{ originURL: URL; host: string; forwardedHost?: string | null; forwardedPort?: string | null; forwardedProto?: string | null; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'forwardedHost' are incompatible.
    Type 'string | null | undefined' is not assignable to type 'string | null'.
      Type 'undefined' is not assignable to type 'string | null'.

218       checkCrossOrigin({
                           ~
219         originURL: new URL(origin),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
223         forwardedProto,
    ~~~~~~~~~~~~~~~~~~~~~~~
224       })
    ~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:242:24 - error TS2379: Argument of type '{ originURL: URL; host: string; forwardedHost: string | null | undefined; forwardedPort: string | null | undefined; forwardedProto: string | null | undefined; }' is not assignable to parameter of type '{ originURL: URL; host: string; forwardedHost?: string | null; forwardedPort?: string | null; forwardedProto?: string | null; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'forwardedHost' are incompatible.
    Type 'string | null | undefined' is not assignable to type 'string | null'.

242       checkCrossOrigin({
                           ~
243         originURL: new URL(referrer),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... 
247         forwardedProto,
    ~~~~~~~~~~~~~~~~~~~~~~~
248       })
    ~~~~~~~

node_modules/@clerk/backend-core/src/Base.ts:283:90 - error TS2379: Argument of type '{ jwtKey: string | undefined; authorizedParties: string[] | undefined; fetchInterstitial: () => Promise<string>; tokenType: "cookie"; }' is not assignable to parameter of type 'BuildAuthenticatedStateOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'jwtKey' are incompatible.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

283     const authenticatedState = await this.buildAuthenticatedState(cookieToken as string, {
                                                                                             ~
284       jwtKey,
    ~~~~~~~~~~~~~
... 
287       tokenType: 'cookie',
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
288     });
    ~~~~~

node_modules/@clerk/backend-core/src/Base.ts:314:66 - error TS2379: Argument of type '{ authorizedParties: string[] | undefined; jwtKey: string | undefined; }' is not assignable to parameter of type 'VerifySessionTokenOptions' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'authorizedParties' are incompatible.
    Type 'string[] | undefined' is not assignable to type 'string[]'.
      Type 'undefined' is not assignable to type 'string[]'.

314       const sessionClaims = await this.verifySessionToken(token, {
                                                                     ~
315         authorizedParties,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
316         jwtKey,
    ~~~~~~~~~~~~~~~
317       });
    ~~~~~~~

node_modules/@clerk/backend-core/src/util/base64url.ts:27:29 - error TS2538: Type 'undefined' cannot be used as an index type.

27     base64UrlEncoding.codes[base64UrlEncoding.chars[i]] = i;
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@clerk/backend-core/src/util/base64url.ts:45:43 - error TS2538: Type 'undefined' cannot be used as an index type.

45     const value = base64UrlEncoding.codes[input[i]];
                                             ~~~~~~~~

node_modules/@clerk/backend-core/src/util/Logger.ts:35:21 - error TS4111: Property 'CLERK_LOGGING' comes from an index signature, so it must be accessed with ['CLERK_LOGGING'].

35     if (process.env.CLERK_LOGGING == 'true') {
                       ~~~~~~~~~~~~~


Found 23 errors in 8 files.

Errors  Files
     3  node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:20
     1  node_modules/@clerk/backend-core/src/api/endpoints/OrganizationApi.ts:79
     1  node_modules/@clerk/backend-core/src/api/endpoints/SessionApi.ts:15
     2  node_modules/@clerk/backend-core/src/api/errors/Errors.ts:12
    12  node_modules/@clerk/backend-core/src/Base.ts:20
     2  node_modules/@clerk/backend-core/src/util/base64url.ts:27
     1  node_modules/@clerk/backend-core/src/util/Logger.ts:35

and here's that tsconfig which does have skipLibCheck set to true.

{
  "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
  "compilerOptions": {
    "lib": ["DOM", "DOM.Iterable", "ES2019"],
    "isolatedModules": true,
    "esModuleInterop": true,
    "jsx": "react-jsx",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "target": "ES2019",
    "strict": true,
    "baseUrl": ".",
    "paths": {
      "~/*": ["./app/*"]
    },

    "exactOptionalPropertyTypes": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "noUncheckedIndexedAccess": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "skipLibCheck": true,

    // Remix takes care of building everything in `remix build`.
    "noEmit": true
  }
}

@convcha
Copy link

convcha commented Nov 11, 2022

Same issue here.

pnpm 7.15.0
tsc 4.8.4
@clerk/remix 1.3.12

tsconfig

{
  "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules"],
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["./app/@types/*"],
      "~/*": ["./app/*"]
    },
    "skipLibCheck": true,
    "composite": false,
    "declaration": true,
    "declarationMap": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "inlineSources": false,
    "moduleResolution": "node",
    "preserveWatchOutput": true,
    "strict": true,
    "noImplicitReturns": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noFallthroughCasesInSwitch": true,
    "noUncheckedIndexedAccess": true,
    "importsNotUsedAsValues": "error",
    "lib": ["DOM", "DOM.Iterable", "ES2019"],
    "isolatedModules": true,
    "jsx": "react-jsx",
    "resolveJsonModule": true,
    "target": "ES2019",
    "allowJs": true,
    // Remix takes care of building everything in `remix build`.
    "noEmit": true
  }
}
tsc result ```shell > tsc --noEmit

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:4:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

4 import { APIClient, APIRequestOptions } from './endpoints';


../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/AllowlistIdentifierApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { AllowlistIdentifier } from '../resources/AllowlistIdentifier';

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/ClientApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { Client } from '../resources/Client';


../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/EmailApi.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { Email } from '../resources/Email';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/InvitationApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { Invitation } from '../resources/Invitation';

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/OrganizationApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { Organization, OrganizationInvitation, OrganizationMembership } from '../resources';


../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/OrganizationApi.ts:3:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

3 import { OrganizationMembershipRole } from '../resources/Enums';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/RedirectUrlApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { RedirectUrl } from '../resources/RedirectUrl';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SessionApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { Session } from '../resources/Session';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SessionApi.ts:3:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

3 import { Token } from '../resources/Token';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SignInTokenApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { SignInToken } from '../resources/SignInTokens';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SMSMessageApi.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { SMSMessage } from '../resources/SMSMessage';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/UserApi.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { OrganizationMembership, User } from '../resources';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/JSON.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import {
  ~~~~~~~~
2   OrganizationInvitationStatus,
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
9   SignUpStatus,
  ~~~~~~~~~~~~~~~
10 } from './Enums';
  ~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/OrganizationInvitation.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { OrganizationInvitationStatus, OrganizationMembershipRole } from './Enums';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/OrganizationMembership.ts:2:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

2 import { OrganizationMembershipRole } from './Enums';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/Token.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { TokenJSON } from './JSON';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/Base.ts:140:57 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.

140     const header = JSON.parse(this.decodeBase64Function(rawHeader));
                                                          ~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/Base.ts:141:58 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.

141     const payload = JSON.parse(this.decodeBase64Function(rawPayload));
                                                           ~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/Base.ts:142:49 - error TS2532: Object is possibly 'undefined'.

142     const signature = this.decodeBase64Function(rawSignature.replace(/_/g, '/').replace(/-/g, '+'));
                                                  ~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/Base.ts:154:29 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.

154     const signature = parse(rawSignature);
                              ~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/types/core.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { ClerkJWTClaims } from '@clerk/types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/types/core.ts:3:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

3 import { AuthErrorReason } from './errors';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/types/jwt.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { ClerkJWTClaims, JWTHeader } from '@clerk/types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/base64url.ts:27:29 - error TS2538: Type 'undefined' cannot be used as an index type.

27     base64UrlEncoding.codes[base64UrlEncoding.chars[i]] = i;
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/base64url.ts:45:43 - error TS2538: Type 'undefined' cannot be used as an index type.

45     const value = base64UrlEncoding.codes[input[i]];
                                           ~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/createGetToken.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { ServerGetToken, ServerGetTokenOptions } from '@clerk/types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/jwt.ts:1:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.

1 import { ClerkJWTClaims } from '@clerk/types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 28 errors in 21 files.

Errors  Files
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/ClerkBackendApi.ts:4
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/AllowlistIdentifierApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/ClientApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/EmailApi.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/InvitationApi.ts:2
   2  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/OrganizationApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/RedirectUrlApi.ts:2
   2  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SessionApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SignInTokenApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/SMSMessageApi.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/endpoints/UserApi.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/JSON.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/OrganizationInvitation.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/OrganizationMembership.ts:2
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/api/resources/Token.ts:1
   4  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/Base.ts:140
   2  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/types/core.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/types/jwt.ts:1
   2  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/base64url.ts:27
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/createGetToken.ts:1
   1  ../../node_modules/.pnpm/@clerk+backend-core@2.8.1/node_modules/@clerk/backend-core/src/util/jwt.ts:1
```  
</details>

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants