-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V3 Beta - errors not reported from preload context #372
Comments
I'm nowhere near a machine to test this but you can probably work around this by initialising the render code in the preload too:
If you're using context isolation, you will need to init the renderer code in the preload AND the isolated renderer context. |
Thank you. It's finally working. For anyone who's looking at this issue in the future this is the code that worked for me. Preload
Main
Renderer
|
It's worth noting that as all events are sent from the main process, you do not need to supply the |
I think reporting errors from the preload context should work out of the box by default but this adds some annoying complications that vary by the users Electron configuration. For non-bundled apps, we automatically inject the preload script which is currently well under 1kB in size. If we want to support reporting errors from this context with zero config, we'll need to include all the renderer code which is currently ~78kB. If we include this code by default, we'll also need to call If users have Why not let users just create their own preload script and choose if they want to support error reporting from this context and pass custom To summarise
|
This is simpler in 3.0.0-beta.2 A preload is no longer required unless you're using Electron < v5 and bundling the main process. If you would like errors reported from the preload then you'll still need to initialise the renderer portion of the sdk there. No options are required unless you need to configure specific renderer integrations.
const { init } = require('@sentry/electron/renderer');
init(); If you have context isolation enabled, the renderer is a different context to the preload so you'll need to |
Hey, @timfish
But I guess that I still need to configure the one in renderer, since that's the instruction from the relevant Sentry doc, that I
Am i right? BTW, |
Versions + Platform
@sentry/electron@v3.0.0-beta.1
all
all
Description
With v3 beta, errors are not reported from the preload context.
The text was updated successfully, but these errors were encountered: