bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
796 stars 187 forks source link

TypeError using Typescript #188

Closed benbieler closed 6 years ago

benbieler commented 6 years ago
          new winston.transports.Console({
            json: true,
            colorize: true
          })

Using .ts results in the following:

[ts] Argument of type '{ json: boolean; colorize: boolean; }' is not assignable
       to parameter of type 'ConsoleTransportOptions'.
       Object literal may only specify known properties, and 'json' does not exist in type 
      'ConsoleTransportOptions'.
rosston commented 6 years ago

Are you using express-winston@3 and winston@3? If so, note that json and colorize transport options (among others) have been removed in winston@3. If you're using v3 of winston, then this is an expected/valid error.

benbieler commented 6 years ago

Ok thanks. Yes I am using winston v3