【发布时间】:2021-11-07 06:06:39
【问题描述】:
Sentry 新手,第一次尝试在我的本地开发环境中设置它。我正在按照安装和配置说明进行操作,但 Sentry 仪表板中没有记录任何内容。浏览器中出现错误,但没有发送到 Sentry。我做错了什么?
React 版本 16.12.0
index.js
const Index = () => {
...
import * as Sentry from "@sentry/react";
import { Integrations } from "@sentry/tracing";
import App from './App';
Sentry.init({
dsn: "https://#####@####.ingest.sentry.io/####",
integrations: [new Integrations.BrowserTracing()],
tracesSampleRate: 1.0,
});
return (
<BrowserRouter history={history}>
<UserContext.Provider value={providerValue}>
<App />
</UserContext.Provider>
</BrowserRouter>
);
}
ReactDOM.render(<Index />, document.getElementById('root'));
故意错误
return <button onClick={methodDoesNotExist}>Break the world</button>;
【问题讨论】: