'Nestjs logger error "A rest element must be last in a tuple type"

I am new to Nestjs and I am trying to build a RESTAPI for an app I am creating. When I run npm run start:dev I see a bunch of "logger.service.ts" errors.

What's strange is, the first time I run the project (after a git clone) npm run start:dev I can access the development server just fine, I can even get a response (localhost). However, as soon as I kill the process (ctrl+c), whenever I run again, the server won't be accessible (that's when I see the errors).


25     log(message: any, ...optionalParams: [...any, string?]): void;
                                             ~~~~~~

../../../node_modules/@nestjs/common/services/console-logger.service.d.ts:31:45 - error TS1256: A rest element must be last in a tuple type.

31     error(message: any, ...optionalParams: [...any, string?, string?]): void;
                                               ~~~~~~

../../../node_modules/@nestjs/common/services/console-logger.service.d.ts:37:44 - error TS1256: A rest element must be last in a tuple type.

37     warn(message: any, ...optionalParams: [...any, string?]): void;
                                              ~~~~~~

../../../node_modules/@nestjs/common/services/console-logger.service.d.ts:43:45 - error TS1256: A rest element must be last in a tuple type.

43     debug(message: any, ...optionalParams: [...any, string?]): void;
                                               ~~~~~~

../../../node_modules/@nestjs/common/services/console-logger.service.d.ts:49:47 - error TS1256: A rest element must be last in a tuple type.

49     verbose(message: any, ...optionalParams: [...any, string?]): void;
                                                 ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:60:45 - error TS1256: A rest element must be last in a tuple type.

60     error(message: any, ...optionalParams: [...any, string?, string?]): void;
                                               ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:65:43 - error TS1256: A rest element must be last in a tuple type.

65     log(message: any, ...optionalParams: [...any, string?]): void;
                                             ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:70:44 - error TS1256: A rest element must be last in a tuple type.

70     warn(message: any, ...optionalParams: [...any, string?]): void;
                                              ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:75:45 - error TS1256: A rest element must be last in a tuple type.

75     debug(message: any, ...optionalParams: [...any, string?]): void;
                                               ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:80:47 - error TS1256: A rest element must be last in a tuple type.

80     verbose(message: any, ...optionalParams: [...any, string?]): void;
                                                 ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:86:52 - error TS1256: A rest element must be last in a tuple type.

86     static error(message: any, ...optionalParams: [...any, string?, string?]): void;
                                                      ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:91:50 - error TS1256: A rest element must be last in a tuple type.

91     static log(message: any, ...optionalParams: [...any, string?]): void;
                                                    ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:96:51 - error TS1256: A rest element must be last in a tuple type.

96     static warn(message: any, ...optionalParams: [...any, string?]): void;
                                                     ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:102:52 - error TS1256: A rest element must be last in a tuple type.

102     static debug(message: any, ...optionalParams: [...any, string?]): void;
                                                       ~~~~~~

../../../node_modules/@nestjs/common/services/logger.service.d.ts:107:54 - error TS1256: A rest element must be last in a tuple type.

107     static verbose(message: any, ...optionalParams: [...any, string?]): void;```




Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source