question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loopback & Raven not working together

See original GitHub issue

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

2.6.4

Description

Using latest loopback and raven "loopback": "3.22.3" "raven": "2.6.4"

Followed these docs for integrating with loopback https://docs.sentry.io/clients/node/integrations/loopback/

server.js looks like this:

const raven = require('raven');

raven.config(
	process.env.SENTRY_DSN, {
		captureUnhandledRejections: true,
		environment: process.env.NODE_ENV
	}).install();

/server/middleware.json looks like this:

	"final:after": {
		"raven#errorHandler": {}
	}

Inside /node_modules/raven/lib/client.js there is an errorHandler function. errorHandler is getting attached, but ravenErrorMiddleware is not getting called.

errorHandler: function() {
    var self = this;
    return function ravenErrorMiddleware(err, req, res, next) {

I am able to generate issues in sentry before the booting the application. For example if I were to add some non-existent middleware called blahblah:

	"final:after": {
		"raven#errorHandler": {},
		"blahblah": {}
	}

The app instantly crashes and I get the error Error: Cannot resolve path "blahblah" as an issue within sentry.

But any errors thrown within the app itself are not caught by sentry.

Any ideas on what I’m doing wrong here?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
stevegr33ncommented, Sep 18, 2018

For now I’m using a work around.

I’ve made a mixin that uses the Loopback hook afterRemoteError to catch any errors and then passes the context to raven.captureException to create a sentry issue.

I will find some time to make a reproducible test case but I’m not sure when that will be yet. Sorry for not being able to provide it sooner.

0reactions
kamilogorekcommented, Oct 16, 2018

Closing due to inactivity 😅 Feel free to reopen if it’s still relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

connection to local raven instance doesn't work using https
Right-click DisableLoopbackCheck, and then click Modify. 7. In the Value data box, type 1, and then click OK. 8. Quit Registry Editor, and...
Read more >
Node.js - Sentry Documentation
Configuring the Client. Next you need to initialize the Raven client and configure it to use your Sentry DSN: JavaScript.
Read more >
RavenDB Clusters | Inside RavenDB
The first, at the cluster level, is composed of nodes working together to achieve the same goal. This is done by using the...
Read more >
Enabling Raven / Sentry integration in a Loopback app
at the top of server.js, but it messed up my other middleware. Also found this as a all-around solution to this problem, but...
Read more >
Raven Rate Control Module (RCM) Operation Manual
Raven Industries shall not be responsible or liable for incidental or consequential damages or a loss of anticipated benefits or profits, work stoppage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found