winston-graylog2
winston-graylog2 copied to clipboard
ERROR:Type 'typeof TransportStream' is not a constructor function type. Version: typescript 3.5.3,
Type 'typeof TransportStream' is not a constructor function type.
Any update about this?
I think the issue is with the import. Changing it to: import TransportStream = require('winston-transport')
fixes the issue
does anyone use typescript and this import works?
import winstonGraylog2 from 'winston-graylog2';
I'm suspecting that language level or language feature may be an issue.
I'm failing with such tsconfig:
"target": "es2016",
// Enables experimental support for ES7 decorators.
"experimentalDecorators": true,
"esModuleInterop": true,
possible fix in https://github.com/namshi/winston-graylog2/pull/76
I can confirm that I can import this say okay and tsc
no longer complain:
import * as WinstonGraylog2 from 'winston-graylog2';
import * as WinstonGraylog2 from 'winston-graylog2';
Hi @glensc Tried this way but then the error exists
Type 'typeof TransportStream' is not a constructor function type.ts(2507)
Do you have esModuleInterop
enabled?
- https://github.com/namshi/winston-graylog2/pull/83#issuecomment-651098968
@glensc Yes it's enabled in my tsconfig file
Sorry for the late reply guys. I no longer use this library myself, so I didn't really have time to check the issue.
Here is the PR that allows to use the lib with both enabled/disabled esModuleInterop
option: https://github.com/namshi/winston-graylog2/pull/84