Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Winston transporter TypeScript error #44

Open
steveklebanoff opened this issue Mar 6, 2019 · 0 comments
Open

Winston transporter TypeScript error #44

steveklebanoff opened this issue Mar 6, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@steveklebanoff
Copy link

The following code does not compile w/ TypeScript:

import { Timber } from '@timberio/node';
import { TimberTransport } from '@timberio/winston';
import * as winston from 'winston';

import { TIMBER_API_KEY } from './constants';

const timberApiKey = TIMBER_API_KEY;
if (typeof timberApiKey === 'undefined') {
    throw new Error('Please specify Timber API Key');
}

const timber = new Timber(timberApiKey);
const transporter = new TimberTransport(timber);
const logger = winston.createLogger({
    transports: [transporter],
});

Versions:

@timberio/node 0.30.0
@timberio/winston 0.30.0
winston 3.2.1
winston-transport 4.3.0

That being said, if I cast transporter as any things seem to work

@binarylogic binarylogic added the bug Something isn't working label Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants