GPTRouter icon indicating copy to clipboard operation
GPTRouter copied to clipboard

`npm run build` returns 4 errors

Open unownone opened this issue 2 years ago • 2 comments

Summary

npm run build ends up returning multiple errors.

Terminal Response

 npm run build

> [email protected] build
> tsc -p tsconfig.json

src/index.ts:29:26 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(obj: object, msg?: string | undefined): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'object'.
  Overload 2 of 3, '(msg: string): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'string'.
  Overload 3 of 3, '(arg: number | boolean): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'number | boolean'.

29         server.log.error(err);
                            ~~~


src/server.ts:66:26 - error TS2769: No overload matches this call.
  Overload 1 of 3, '(obj: object, msg?: string | undefined): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'object'.
  Overload 2 of 3, '(msg: string): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'string'.
  Overload 3 of 3, '(arg: number | boolean): void', gave the following error.
    Argument of type 'unknown' is not assignable to parameter of type 'number | boolean'.

66         server.log.error(err);
                            ~~~


src/server.ts:84:44 - error TS7006: Parameter 'request' implicitly has an 'any' type.

84     server.decorate("authenticate", async (request, reply) => {
                                              ~~~~~~~

src/server.ts:84:53 - error TS7006: Parameter 'reply' implicitly has an 'any' type.

84     server.decorate("authenticate", async (request, reply) => {
                                                       ~~~~~


Found 4 errors in 2 files.

Errors  Files
     1  src/index.ts:29
     3  src/server.ts:66

unownone avatar Dec 14 '23 07:12 unownone

import { FastifyRequest, FastifyReply } from 'fastify';

server.decorate("authenticate", async (request: FastifyRequest, reply: FastifyReply) => {

Superblue045 avatar Jan 31 '24 17:01 Superblue045

Ensure that your TypeScript configuration (tsconfig.json) is set up correctly, with appropriate settings for type checking and type inference. If you're using third-party libraries, ensure you have their type definitions installed (@types/library-name) or that they provide built-in TypeScript support.

Superblue045 avatar Jan 31 '24 17:01 Superblue045