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: Invalid transport, must be an object with a log method. #14

Open
cherealnice opened this issue Mar 25, 2019 · 1 comment
Open

Comments

@cherealnice
Copy link

Hi! Thank you for this transport. I am installing on a project, and keep getting this error: Error: Invalid transport, must be an object with a log method.

Here's my code:

const sentryOptions = {
  dsn: config.has('sentry') ? config.get('sentry').DSN : '',
  level: 'error',
};

const Logger = winston.createLogger();

Logger.add(Sentry, sentryOptions);

I have logged the DSN to make sure it's getting read correctly.

winston-sentry-log v1.0.11
winston v3.2.1

Any insight is appreciated!

@rasmuslp
Copy link

rasmuslp commented Apr 5, 2019

This is from Winston, which have deprecated that usage of the API. I believe Winston previously invoked the constructor, but now requires an instantiated transport instead.

Do this

Logger.add(new Sentry(sentryOptions));

Edit: I believe you will encounter this next #15

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