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

Broken typescript definition? #131

Closed
xduseko opened this issue Aug 13, 2018 · 3 comments
Closed

Broken typescript definition? #131

xduseko opened this issue Aug 13, 2018 · 3 comments

Comments

@xduseko
Copy link

xduseko commented Aug 13, 2018

Hi,

I'm trying to use [email protected] because it's the last version compatible with [email protected], right? Version 3.x is not stable yet, it contains major bugs like (e.g. winstonjs/winston#1426). Anyway problem is that typing seems to be somehow wrong.
 

import {MongoDB} from "winston-mongodb";

TS2305: module has no exported member 'MongoDB'
 

import {transports} from "winston";
import "winston-mongodb";

new transports.MongoDB({});

TS2339: Property 'MongoDB' does not exists on type 'Transports'
 

import {transports} from "winston-mongodb";
new transports.MongoDB({});

TypeError: Cannot read property 'MongoDB' of undefined
 

How can I properly instantiate MongoDB transport in typescript? An example would be appreciated. Thanks!

@yurijmikhalevich
Copy link
Member

Hi @xduseko.

Version 3.0.2 is the latest version supporting [email protected] and has fixed TypeScript definitions.

@xduseko
Copy link
Author

xduseko commented Aug 14, 2018

Oh thanks, I haven't seen that in release list at https://github.com/winstonjs/winston-mongodb/releases.

@yurijmikhalevich
Copy link
Member

@xduseko oops. We do miss this in a releases pane. Thank you!

The best way to check available versions is: npm info <module-name> versions.

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

No branches or pull requests

2 participants