lazywithclass / winston-cloudwatch

Send logs to Amazon Cloudwatch using Winston.
MIT License
258 stars 105 forks source link

Type 'typeof WinstonCloudwatch' has no construct signatures` #221

Open thom-nic opened 1 year ago

thom-nic commented 1 year ago

Full error:

TSError: ⨯ Unable to compile TypeScript
app/logger.ts (44,19): This expression is not constructable.
  Type 'typeof WinstonCloudwatch' has no construct signatures. (2351)

code:

import * as WinstonCloudwatch from 'winston-cloudwatch';
import winston from 'winston';
import pkg from '../package.json';

  winston.add(new WinstonCloudwatch({
    logGroupName: pkg.name,
    logStreamName: 'app',
  }));

Runnng typescript@5 and Nodejs 14

linosorice commented 1 year ago

I resolved changing the import

import WinstonCloudWatch from 'winston-cloudwatch'