getsentry / sentry-electron

The official Sentry SDK for Electron
https://sentry.io/
MIT License
225 stars 58 forks source link

Fetch API cannot load sentry-ipc://sentry-electron.scope/sentry_key. URL scheme "sentry-ipc" is not supported. #1013

Open DanishMehmood-bit opened 4 hours ago

DanishMehmood-bit commented 4 hours ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Electron SDK Version

5.7.0

Electron Version

33.0.2

What platform are you using?

Windows

Link to Sentry event

No response

Steps to Reproduce

Hi. I'm trying to setup session replay in our electron project. I'm following the documentation and added it like this: Image

Since we do have csp in place and docs said to add worker-src directive to the csp, so I did like this: worker-src 'self' blob:

Now whenever I run the app, I get these errors in the console: Image

I'm using sentry on protocol mode and it is registered in sentry itself.

Expected Result

Sentry should send the requests as mentioned in the docs unless some step is missing in the docs itself.

Actual Result

Getting this error in console Image

timfish commented 3 hours ago

It's hard to know exactly what's going on without a full example.

Are you starting Sentry in the main process? Are you starting it before the app ready event? Is it only Replay events that are not working or are all events not making it through the main process?

DanishMehmood-bit commented 2 hours ago

It's hard to know exactly what's going on without a full example.

Are you starting Sentry in the main process? Are you starting it before the app ready event? Is it only Replay events that are not working or are all events not making it through the main process?

Yes sentry is initialized in the main process this way: Image

and yes we initialize sentry before app is ready.

Sentry is reporting errors, its just session replay which is throwing the error

timfish commented 2 hours ago

If you disable CSP, does Replay start working? I'm just trying to narrow down the cause.