revolt.js icon indicating copy to clipboard operation
revolt.js copied to clipboard

bug: TSC reports 17 errors

Open ggtylerr opened this issue 2 years ago • 2 comments

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.

ggtylerr avatar May 30 '22 10:05 ggtylerr

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

NightScript370 avatar Jul 13 '22 05:07 NightScript370

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 avatar Jul 17 '22 17:07 ggtylerr

Still happening.

BoQsc avatar Nov 27 '22 17:11 BoQsc

This was fixed at some point.

image

insertish avatar Jan 24 '23 15:01 insertish