revoltchat / revolt.js

Modern Typescript library for interacting with Revolt.
https://revolt.js.org
MIT License
216 stars 54 forks source link

bug: TSC reports 17 errors #57

Closed ggtylerr closed 1 year ago

ggtylerr commented 2 years ago

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.

NightScript370 commented 1 year ago

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

ggtylerr commented 1 year ago

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

full log ```js node_modules/revolt-api/dist/index.d.ts:61:81 - error TS2536: Type '"path"' cannot be used to index type 'Routes'. 61 req, 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; ~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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; ~~~~~~~~~~~~~~~~~ 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) | 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 ```
BoQsc commented 1 year ago

Still happening.

insertish commented 1 year ago

This was fixed at some point.

image