How to use sentry/node


#1

I am having a hard time trying to sentry working for node.
Yes it not a problem to just do

const Sentry = require('@sentry/node');
Sentry.init({ dsn: config.get('sentry.dsn') });
Sentry.captureMessage("hello world");

But well it doesn’t really work with webframework koa it captures no errors.
I have then tried to figure out what todo but the docs well are some what split

this says i should use a latency client

this says something else but still not useful, as well i did that and its not work
https://sentry.io/settings///install/node/

this says something useful but well it doesn’t work, might be because koa isn’t express or it might be the version of node (10) i am running is too recent and no support for it yet?
https://sentry.io/settings///install/node-express/

The error i get

TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function. Received type undefined
    at _addListener (events.js:200:11)
    at Domain.addListener (events.js:259:10)
    at sentryRequestMiddleware (/Users/kaareal/code/sense-api/node_modules/@sentry/node/dist/handlers.js:155:15)
    at dispatch (/Users/kaareal/code/sense-api/node_modules/koa-compose/index.js:42:32)
    at /Users/kaareal/code/sense-api/node_modules/koa-compose/index.js:34:12
    at Application.handleRequest (/Users/kaareal/code/sense-api/node_modules/koa/lib/application.js:151:12)
    at Server.handleRequest (/Users/kaareal/code/sense-api/node_modules/koa/lib/application.js:133:19)
    at Server.emit (events.js:182:13)
    at Server.EventEmitter.emit (domain.js:442:20)
    at parserOnIncoming (_http_server.js:658:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)

What todo ?