-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Closed as not planned
Copy link
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 SDK are you using?
@sentry/react
SDK Version
^8.47.0
Framework Version
React 18.2
Link to Sentry event
Reproduction Example/SDK Setup
import React from "react";
import ReactDOM from "react-dom/client";
import {
init,
browserTracingIntegration,
replayIntegration,
captureConsoleIntegration,
} from "@sentry/react";
import App from "@/src/App.jsx";
import { getEnv } from "@/src/envUtils.js";
import packageProps from "@root/package.json";
const isDev = getEnv("MODE") !== "production";
init({
release: `Ad Units: v${packageProps.version}`,
environment: getEnv("MODE"),
dsn: getEnv("VITE_SENTRY_DSN"),
integrations: [
browserTracingIntegration(),
replayIntegration({
maskAllText: false,
blockAllMedia: false,
maskAllInputs: true,
}),
captureConsoleIntegration({
levels: ["error"],
}),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^\//],
// Session Replay
replaysSessionSampleRate: 0, // This sets the sample rate at 0%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: isDev ? 0 : 0.5, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});Steps to Reproduce
- Build a vite app using React, and initialise Sentry as above in the main file (i.e. before the App component),
- Every works as expected, until you add chunking to the vite config and chunk sentry/react, see below:
export default () => {
return defineConfig({
plugins: [react()],
build: {
lib: {
entry: resolve(__dirname, "src/main.jsx"),
name: "adunits",
fileName: "index",
formats: ["es"],
},
rollupOptions: {
output: {
entryFileNames: "index.js",
assetFileNames: "index.css",
manualChunks: {
sentryreact: ["@sentry/react"],
},
},
},
},
});
};
Now the error “Multiple Sentry Session Replay instances are not supported” occurs in Sentry in production.
Expected Result
No error should occur
Actual Result
“Multiple Sentry Session Replay instances are not supported” error occurs
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Community