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

npm run build returns 4 errors #4

Open
unownone opened this issue Dec 14, 2023 · 2 comments
Open

npm run build returns 4 errors #4

unownone opened this issue Dec 14, 2023 · 2 comments

Comments

@unownone
Copy link
Contributor

Summary

npm run build ends up returning multiple errors.

Terminal Response

 npm run build

> model-router@1.0.0 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
@Superblue045
Copy link

import { FastifyRequest, FastifyReply } from 'fastify';

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

@Superblue045
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants