Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR:Type 'typeof TransportStream' is not a constructor function type. Version: typescript 3.5.3, #82

Open
li1224632854 opened this issue Apr 29, 2020 · 9 comments · May be fixed by #83

Comments

@li1224632854
Copy link

li1224632854 commented Apr 29, 2020

Type 'typeof TransportStream' is not a constructor function type.
image

@ngocketit
Copy link

Any update about this?

@ngocketit
Copy link

I think the issue is with the import. Changing it to: import TransportStream = require('winston-transport') fixes the issue

@glensc
Copy link

glensc commented Jun 29, 2020

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,

@glensc
Copy link

glensc commented Jun 29, 2020

possible fix in #76

@glensc glensc mentioned this issue Jun 29, 2020
@glensc
Copy link

glensc commented Jun 29, 2020

I can confirm that I can import this say okay and tsc no longer complain:

import * as WinstonGraylog2 from 'winston-graylog2';

@glensc glensc linked a pull request Jun 29, 2020 that will close this issue
@naveenmscripts
Copy link

naveenmscripts commented Jun 29, 2020

import * as WinstonGraylog2 from 'winston-graylog2';

Hi @glensc Tried this way but then the error exists

image

Type 'typeof TransportStream' is not a constructor function type.ts(2507)

@glensc
Copy link

glensc commented Jun 29, 2020

Do you have esModuleInterop enabled?

@naveenmscripts
Copy link

@glensc Yes it's enabled in my tsconfig file

@schfkt
Copy link
Collaborator

schfkt commented Jul 3, 2020

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: #84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants