bug: TSC reports 17 errors #17

Closed
opened 2026-02-16 12:26:47 -05:00 by yindo · 4 comments
Owner

Originally created by @ggtylerr on GitHub (May 30, 2022).

What happened?

When running tsc on any typescript project using revolt.js (including the example one provided in revolt.js.org), it'll give these errors:
image

Hastebin (posted there to prevent clutter)

Workaround

You can add skipLibCheck: true to your tsconfig.json, which would skip checking all libraries entirely. Alternatively you can just ignore the errors caused by revolt-api and start your code anyways.

Obviously though, that doesn't fix the wider issue, and some stuff might be broken.

Originally created by @ggtylerr on GitHub (May 30, 2022). ### What happened? When running `tsc` on any typescript project using revolt.js (including the example one provided in revolt.js.org), it'll give these errors: ![image](https://user-images.githubusercontent.com/28498877/170973984-586c2eef-91e0-4974-a9c8-ef6431605ca9.png) # [Hastebin](https://www.toptal.com/developers/hastebin/lujozazoto.lua) (posted there to prevent clutter) ## Workaround You can add `skipLibCheck: true` to your `tsconfig.json`, which would skip checking all libraries entirely. Alternatively you can just ignore the errors caused by `revolt-api` and start your code anyways. Obviously though, that doesn't fix the wider issue, and some stuff might be broken.
yindo added the bug label 2026-02-16 12:26:47 -05:00
yindo closed this issue 2026-02-16 12:26:47 -05:00
Author
Owner

@NightScript370 commented on GitHub (Jul 13, 2022):

I cannot see the contents of the HasteBin link you posted. Could anyone else please confirm?

@NightScript370 commented on GitHub (Jul 13, 2022): I cannot see the contents of the HasteBin link you posted. Could anyone else please confirm?
Author
Owner

@ggtylerr commented on GitHub (Jul 17, 2022):

I cannot see the contents of the HasteBin link you posted. Could anyone else please confirm?

full log
node_modules/revolt-api/dist/index.d.ts:61:81 - error TS2536: Type '"path"' cannot be used to index type 'Routes'.

61     req<Method extends Methods, Routes extends PickRoutes<Method>, Path extends Routes['path'], Route extends Routes & {
                                                                                   ~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:64:44 - error TS2536: Type '"params"' cannot be used to index type 'Route'.

64     }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                              ~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:64:99 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

64     }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                                                                                     ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:75:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'.

75     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                              ~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:75:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

75     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                                                                     ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:86:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

86     }>(path: Path): Promise<Route['response']>;
                               ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:97:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'.

97     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                              ~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:97:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

97     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                                                                     ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:108:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

108     }>(path: Path): Promise<Route['response']>;
                                ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:119:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'.

119     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                               ~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:119:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

119     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                                                                      ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:130:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

130     }>(path: Path): Promise<Route['response']>;
                                ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:141:58 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

141     }>(path: Path, config?: AxiosRequestConfig): Promise<Route['response']>;
                                                             ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:152:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

152     }>(path: Path): Promise<Route['response']>;
                                ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:163:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'.

163     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                               ~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:163:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

163     }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>;
                                                                                      ~~~~~~~~~~~~~~~~~

node_modules/revolt-api/dist/index.d.ts:174:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'.

174     }>(path: Path): Promise<Route['response']>;
                                ~~~~~~~~~~~~~~~~~

node_modules/revolt.js/dist/Client.d.ts:85:15 - error TS2304: Cannot find name 'Session'.

85     session?: Session | string;
                 ~~~~~~~

node_modules/revolt.js/dist/Client.d.ts:144:33 - error TS2304: Cannot find name 'Session'.

144     useExistingSession(session: Session): Promise<((username: string, loginAfterSuccess?: boolean | undefined) => Promise<void>) | undefined>;
                                    ~~~~~~~

node_modules/revolt.js/dist/websocket/notifications.d.ts:16:5 - error TS2304: Cannot find name 'Session'.

16 } & Session) | {
       ~~~~~~~


Found 20 errors in 3 files.

Errors  Files
    17  node_modules/revolt-api/dist/index.d.ts:61
     2  node_modules/revolt.js/dist/Client.d.ts:85
     1  node_modules/revolt.js/dist/websocket/notifications.d.ts:16
@ggtylerr commented on GitHub (Jul 17, 2022): > I cannot see the contents of the HasteBin link you posted. Could anyone else please confirm? <details> <summary>full log</summary> ```js node_modules/revolt-api/dist/index.d.ts:61:81 - error TS2536: Type '"path"' cannot be used to index type 'Routes'. 61 req<Method extends Methods, Routes extends PickRoutes<Method>, Path extends Routes['path'], Route extends Routes & { ~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:64:44 - error TS2536: Type '"params"' cannot be used to index type 'Route'. 64 }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:64:99 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 64 }>(method: Method, path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:75:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'. 75 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:75:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 75 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:86:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 86 }>(path: Path): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:97:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'. 97 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:97:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 97 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:108:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 108 }>(path: Path): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:119:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'. 119 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:119:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 119 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:130:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 130 }>(path: Path): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:141:58 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 141 }>(path: Path, config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:152:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 152 }>(path: Path): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:163:28 - error TS2536: Type '"params"' cannot be used to index type 'Route'. 163 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:163:83 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 163 }>(path: Path, params: Route['params'], config?: AxiosRequestConfig): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt-api/dist/index.d.ts:174:29 - error TS2536: Type '"response"' cannot be used to index type 'Route'. 174 }>(path: Path): Promise<Route['response']>; ~~~~~~~~~~~~~~~~~ node_modules/revolt.js/dist/Client.d.ts:85:15 - error TS2304: Cannot find name 'Session'. 85 session?: Session | string; ~~~~~~~ node_modules/revolt.js/dist/Client.d.ts:144:33 - error TS2304: Cannot find name 'Session'. 144 useExistingSession(session: Session): Promise<((username: string, loginAfterSuccess?: boolean | undefined) => Promise<void>) | undefined>; ~~~~~~~ node_modules/revolt.js/dist/websocket/notifications.d.ts:16:5 - error TS2304: Cannot find name 'Session'. 16 } & Session) | { ~~~~~~~ Found 20 errors in 3 files. Errors Files 17 node_modules/revolt-api/dist/index.d.ts:61 2 node_modules/revolt.js/dist/Client.d.ts:85 1 node_modules/revolt.js/dist/websocket/notifications.d.ts:16 ``` </details>
Author
Owner

@BoQsc commented on GitHub (Nov 27, 2022):

Still happening.

@BoQsc commented on GitHub (Nov 27, 2022): Still happening.
Author
Owner

@insertish commented on GitHub (Jan 24, 2023):

This was fixed at some point.

image

@insertish commented on GitHub (Jan 24, 2023): This was fixed at some point. ![image](https://user-images.githubusercontent.com/38285861/214342478-0055c14a-2e8f-4824-81e6-f2e921fdbdf5.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/javascript-client-sdk#17