Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/vue
SDK Version
7.25
Framework Version
Vue 2.7.14
Link to Sentry event
No response
Steps to Reproduce
Initialize Sentry without Replay following the Replay docs:
Sentry.init({
dsn: config.sentryDsn
replaysOnErrorSampleRate: 1.0,
integrations: [],
})
// initialize Replay outside of integrations
const replay = new Sentry.Replay()
replay.start() // no recording triggered on error
Expected Result
Expected recording to be triggered on error and show up in the UI. This doesn't happen.
Actual Result
No recording is sent to UI. This is because _setup
is not called when Replay
is initialized outside of the integrations array. _setup
is responsible for initializing a ReplayContainer
instance which is required to actually start a recording. The result is when Replay.start
is called and Replay
has been initialized outside of the Sentry config, no recording every takes place. I am able to manually start recording by doing this though:
const replay = new Sentry.Replay()
replay.setupOnce() // this method must be called to manually set up before starting.
replay.start()
I do not believe this the intended behavior. Or maybe this is intentional and the docs just need updated?
It looks like this could be fixed by calling setupOnce
inside of Replay.start
when it is called if a _setupComplete
flag has not been previously set.