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.

Raven.js does not get stack frames from an Electron applications that uses "require" in the renderer process

See original GitHub issue

Electron is a popular application framework from GitHub that allows you to create desktop applications with JavaScript. It’s great and easy.

Unfortunately, Raven.js is bugged with Electron applications. When an error occurs in an included JavaScript file using require, the stack frame is not reported to Sentry, so you can’t actually see the line number of where the error occurred.

I’ve created an extremely minimal example repository (with documentation) that illustrates the problem: https://github.com/Zamiell/electron-test/

Versions:

Raven.js: 3.9.1 Chromium: 53.0.2785.143 OS: Windows 7 Professional Node: 6.5.0 Electron: 1.4.13

Altogether this is a deal-breaking bug, as Sentry is pretty useless for my use case without actual line number reporting. =(

Additional discussion about the problem:

Electron applications are unique in that Chromium (the browser) gets access to some of the Node APIs. So you can do things that you wouldn’t normally be able to do in a browser. Like, for example, loading some functions from a separate file called extra-functions.js:

const extraFunctions = require('./extra-functions');
extraFunctions.doAThing();

In my application, I’ve utilized this technique in order to split up code from one big file into lots of little files (for organizational purposes).

However, since doing require in a browser is unconventional, I suspect it is messing up Raven.js interactions with the stack frame.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Zamiellcommented, Feb 22, 2017

For anyone else reading this, I’ve had success in ignoring raven-js completely and using the native Node client (raven-node) in my Electron application.

0reactions
kamilogorekcommented, Sep 28, 2017

Already fixed in latest version:

screen shot 2017-09-28 at 13 38 34

Also different test case in Sentry Dashboard:

screen shot 2017-09-28 at 13 15 09
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sentry.js submitting incomplete stack trace? - SDKs
Raven.js does not get stack frames from an Electron applications that uses "require" in the renderer process ... Electron is a popular application ......
Read more >
Unable to use Node.js APIs in renderer process - Stack Overflow
Update: the answer below is a workaround. You should not disable contextIsolation and you should not enable nodeIntegration .
Read more >
Electron | Sentry Documentation
Learn how to use Sentry with Electron. ... It can capture JavaScript exceptions in the main process and renderers, as well as collect...
Read more >
Electron + Sentry: Monitoring your production app ... - Requestly
It can capture JavaScript exceptions in the main process and renderers, as well as collect native crash reports (Minidumps). How to add sentry...
Read more >
Electron | Sentry Documentation
@sentry/electron is the official Sentry SDK for Electron applications. It can capture JavaScript exceptions in the main and renderer processes, as well as ......
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