Skip to content
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

Replay Console not working as expected #881

Closed
3 tasks done
dbroadhurst opened this issue Apr 16, 2024 · 10 comments · Fixed by #885
Closed
3 tasks done

Replay Console not working as expected #881

dbroadhurst opened this issue Apr 16, 2024 · 10 comments · Fixed by #885
Assignees

Comments

@dbroadhurst
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Electron SDK Version

4.22

Electron Version

25.6

What platform are you using?

Windows

Link to Sentry event

No response

Steps to Reproduce

import * as Sentry from '@sentry/browser'
import { captureConsoleIntegration } from '@sentry/integrations'

Sentry.init({
  dsn: 'XXXX',
  integrations: [
    captureConsoleIntegration({
      levels: ['log', 'info', 'warn', 'error', 'debug', 'assert']
    }),
    Sentry.replayIntegration({
      maskAllText: false,
      blockAllMedia: false
    })
  ],
  // Session Replay
  replaysSessionSampleRate: 1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
  replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
})

Expected Result

Expect to see console output in the replay console window

Actual Result

No console logs appear in the replay console window except when there's an exception.

@dbroadhurst
Copy link
Author

In addition when I replace

import * as Sentry from '@sentry/browser'

with

import * as Sentry from '@sentry/electron/renderer'

I get the following error. I'm confused which import to use since the docs show both

Type 'IntegrationFnResult' is not assignable to type 'Integration'.
  Types of property 'setup' are incompatible.

@timfish
Copy link
Collaborator

timfish commented Apr 16, 2024

No console logs appear in the replay console window except when there's an exception.

This might be because breadcrumbs aren't collected in the Electron renderer process. I'll look into this!

Type 'IntegrationFnResult' is not assignable to type 'Integration'.

It sounds like your Sentry dependency versions are mismatched. For v4.22.0 of the Electron SDK, your other Sentry dependencies should all be v7.109.0:
https://github.com/getsentry/sentry-electron/blob/4.22.0/package.json#L58-L62

@dbroadhurst
Copy link
Author

I got import * as Sentry from '@sentry/electron/renderer' working by locking the integrations package to 7.109.0. Didn't resolve the console log issue.

@dbroadhurst
Copy link
Author

@timfish Pulled latest, still not seeing cosole.log in the replay console window except when an exception happens.

@timfish
Copy link
Collaborator

timfish commented Apr 23, 2024

The fix has been merged but I haven't cut a release yet. I should get around to doing that tomorrow!

@timfish
Copy link
Collaborator

timfish commented Apr 24, 2024

Once this issue has been closed, v4.24.0 will be on npm!

@dbroadhurst
Copy link
Author

@timfish Pulled 4.24.0, checked package.json and package-lock.json, still not seeing console.log in the replay console window except when an exception happens.

@timfish timfish reopened this Apr 25, 2024
@billyvg
Copy link
Member

billyvg commented May 2, 2024

I've confirmed this is a bug with our replay SDK: looks like we only listen to the current scope in our replay SDK. the electron SDK clears the breadcrumbs on scope before the replay listener can access it.

This is addressed in v8 of our replay SDK by using the beforeAddBreadcrumb hook.

@timfish
Copy link
Collaborator

timfish commented May 3, 2024

@billyvg has been looking into this and we believe this issues is fixed in the next major version. We're looking into getting this backported but you could try the beta.

@dbroadhurst
Copy link
Author

dbroadhurst commented May 9, 2024

Confirmed switching to 5.0.0-beta.0 resolves the console log issue along with some other issues.

btw - captureConsoleIntegration causes a build issue but everything seems to work without this integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants