Closed JeffAroma closed 3 months ago
What have you tried exactly? Have you tried https://docs.sentry.io/platforms/javascript/guides/vue/session-replay/#lazy-loading-replay ?
I've tried:
import * as Sentry from '@sentry/vue';
...
const replay = Sentry.getReplay();
replay.start();
but getReplay()
does not exist.
I've also tried
import * as Sentry from '@sentry/vue';
...
const replay = Sentry.replayIntegration();
replay.start();
but here I get the afore mentioned error.
Here is my config of Sentry:
sentry: {
lazy: false,
clientIntegrations: {
Replay: {
maskAllText: false,
blockAllMedia: false,
},
},
release: {
setCommits: {
auto: true,
},
},
publishRelease: {
authToken: process.env.SENTRY_AUTH_TOKEN,
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
errorHandler(error) {
console.error(`Sentry Release Error: ${error.message}`);
},
},
clientConfig: {
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 0,
},
},
The Sentry documentation says not the enable the integration globally. So remove Replay
from clientIntegrations
.
Then something like this might work but haven't tried:
const Sentry = await import('@sentry/vue');
Sentry.addIntegration(Sentry.replayIntegration());
Note that you have to ensure that this code doesn't execute on the server-side since it's a client-only integration.
Thanks for advice, unfortunately I get the same error.
You would need to create an example project that reproduces the issue for me to look into it.
Or at least show exactly where you are executing this code from.
It seems that I messed something up earlier. I've retested your snippet and it does work! Thanks for your (really quick) help on this.
Hi,
We would like to start manually replays (on a specific page) but I couldn't find a way to do it. I've tried to look at the
$sentry
object but didn't find a way to do it. I've also tried to use the official Sentry documentation and do it manually as specified but I got theError: Multiple Sentry Session Replay instances are not supported
error. Do you have an idea on how to do it?Versions: @nuxtjs/sentry@^8.0.7 @sentry/core@7.100.1