Open jlongster opened 6 years ago
I found out another approach for running my node backend that may solve this. Supposedly you can fork the electron process which creates a standalone node process which is what I want, and would solve all the issues like this one (I could use raven-node like normal). I expect to hit issues but hopefully it works smoothly.
Electron has two type of processes, the main process which controls everything, and individual renderer processes which represent separate UI processes. The renderer process may have "node integration" enabled, meaning you have full access to node APIs.
You want to run as little JS on the main process as possible (see my post). Because of this, I'm running my entire backend in a hidden renderer process that I basically use as just a node process (there's zero UI and no usage of browser APIs). It's treated as a node program.
The problem is sentry really wants you to use
raven-js
in the renderer process. Runningraven-node
inside a renderer process that has full node integration doesn't work. And it doesn't work in a big way: it crashes electron. For some reason it crashes when trying to read the source files here: https://github.com/getsentry/raven-node/blob/2060d3cb0297fd3f3faa132a0f9151ca81dfabbb/lib/utils.js#L270, even though I can read those files fine if I dofs.readFile
somewhere else in my code in the renderer process.My files aren't sourcemapped, so by using
raven-js
, I won't get any source info in sentry. There's zero way for me to get it work. Since my files aren't sourcemapped, I can't upload a sourcemap. But since raven-node doesn't work, I have to useraven-js
which expects sourcemaps.Do you want to request a feature or report a bug? Sort of both
Has someone had this problem before? I could not find anything
(using latest version of raven-node)