Raven.js does not get stack frames from an Electron applications that uses "require" in the renderer process
See original GitHub issueElectron 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:
- Created 7 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top GitHub Comments
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.
Already fixed in latest version:
Also different test case in Sentry Dashboard: