De acordo com o guia de configuração do Sentry para um projeto React FE
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: "SOME_SENTRY_DNS",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true
});
const container = document.getElementById(“app”);
const root = createRoot(container);
root.render(<App />);
Eu ajustei isso para
const SENTRY_DSN = process.env.REACT_APP_SENTRY_DSN;
const SENTRY_ENV = process.env.REACT_APP_SENTRY_ENVIRONMENT || "development";
Sentry.init({
dsn: SENTRY_DSN,
environment: SENTRY_ENV,
sendDefaultPii: true,
debug: true,
autoSessionTracking: false,
beforeSend(event) {
console.log("Sentry about to send event:", event);
return event;
},
});
mas ainda continuo recebendo
Sentry Logger [warn]: Discarded session because of missing or non-string release