sentry-react-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSentry React SDK
Sentry React SDK
Opinionated wizard that scans your React project and guides you through complete Sentry setup.
这是一个智能向导,会扫描你的React项目并引导你完成完整的Sentry配置流程。
Invoke This Skill When
触发此技能的场景
- User asks to "add Sentry to React" or "set up Sentry" in a React app
- User wants error monitoring, tracing, session replay, profiling, or logging in React
- User mentions , React Sentry SDK, or Sentry error boundaries
@sentry/react - User wants to monitor React Router navigation, Redux state, or component performance
Note: SDK versions and APIs below reflect current Sentry docs at time of writing (≥8.0.0). Always verify against docs.sentry.io/platforms/javascript/guides/react/ before implementing.@sentry/react
- 用户要求「为React添加Sentry」或在React应用中「配置Sentry」
- 用户需要为React应用实现错误监控、链路追踪、会话重放、性能分析或日志功能
- 用户提及、React Sentry SDK或Sentry错误边界
@sentry/react - 用户希望监控React Router导航、Redux状态或组件性能
注意: 以下SDK版本和API基于当前Sentry文档(编写时≥8.0.0)。 实施前请务必对照Sentry官方文档进行验证。@sentry/react
Phase 1: Detect
阶段一:项目检测
Run these commands to understand the project before making any recommendations:
bash
undefined在给出任何建议前,先运行以下命令了解项目情况:
bash
undefinedDetect React version
检测React版本
cat package.json | grep -E '"react"|"react-dom"'
cat package.json | grep -E '"react"|"react-dom"'
Check for existing Sentry
检查是否已安装Sentry
cat package.json | grep '"@sentry/'
cat package.json | grep '"@sentry/'
Detect router
检测路由库
cat package.json | grep -E '"react-router-dom"|"@tanstack/react-router"'
cat package.json | grep -E '"react-router-dom"|"@tanstack/react-router"'
Detect state management
检测状态管理库
cat package.json | grep -E '"redux"|"@reduxjs/toolkit"'
cat package.json | grep -E '"redux"|"@reduxjs/toolkit"'
Detect build tool
检测构建工具
ls vite.config.ts vite.config.js webpack.config.js craco.config.js 2>/dev/null
cat package.json | grep -E '"vite"|"react-scripts"|"webpack"'
ls vite.config.ts vite.config.js webpack.config.js craco.config.js 2>/dev/null
cat package.json | grep -E '"vite"|"react-scripts"|"webpack"'
Detect logging libraries
检测日志库
cat package.json | grep -E '"pino"|"winston"|"loglevel"'
cat package.json | grep -E '"pino"|"winston"|"loglevel"'
Check for companion backend in adjacent directories
检查相邻目录是否存在配套后端
ls ../backend ../server ../api 2>/dev/null
cat ../go.mod ../requirements.txt ../Gemfile ../pom.xml 2>/dev/null | head -3
**What to determine:**
| Question | Impact |
|----------|--------|
| React 19+? | Use `reactErrorHandler()` hook pattern |
| React <19? | Use `Sentry.ErrorBoundary` |
| `@sentry/react` already present? | Skip install, go straight to feature config |
| `react-router-dom` v5 / v6 / v7? | Determines which router integration to use |
| `@tanstack/react-router`? | Use `tanstackRouterBrowserTracingIntegration()` |
| Redux in use? | Recommend `createReduxEnhancer()` |
| Vite detected? | Source maps via `sentryVitePlugin` |
| CRA (`react-scripts`)? | Source maps via `@sentry/webpack-plugin` in CRACO |
| Backend directory found? | Trigger Phase 4 cross-link suggestion |
---ls ../backend ../server ../api 2>/dev/null
cat ../go.mod ../requirements.txt ../Gemfile ../pom.xml 2>/dev/null | head -3
**需要确定的关键信息:**
| 问题 | 影响 |
|----------|--------|
| 是否为React 19+? | 使用`reactErrorHandler()`钩子模式 |
| 是否为React <19? | 使用`Sentry.ErrorBoundary`组件 |
| 是否已安装`@sentry/react`? | 跳过安装步骤,直接进入功能配置 |
| React Router版本是v5 / v6 / v7? | 决定使用对应的路由集成方案 |
| 是否使用`@tanstack/react-router`? | 使用`tanstackRouterBrowserTracingIntegration()` |
| 是否使用Redux? | 建议添加`createReduxEnhancer()` |
| 是否使用Vite? | 通过`sentryVitePlugin`配置Source Maps |
| 是否使用CRA(`react-scripts`)? | 在CRACO中通过`@sentry/webpack-plugin`配置Source Maps |
| 是否存在后端目录? | 触发阶段四的跨端配置建议 |
---Phase 2: Recommend
阶段二:配置建议
Present a concrete recommendation based on what you found. Don't ask open-ended questions — lead with a proposal:
Recommended (core coverage):
- ✅ Error Monitoring — always; captures unhandled errors, React error boundaries, React 19 hooks
- ✅ Tracing — React SPAs benefit from page load, navigation, and API call tracing
- ✅ Session Replay — recommended for user-facing apps; records sessions around errors
Optional (enhanced observability):
- ⚡ Logging — structured logs via ; recommend when structured log search is needed
Sentry.logger.* - ⚡ Profiling — JS Self-Profiling API (⚠️ experimental; requires cross-origin isolation headers)
Recommendation logic:
| Feature | Recommend when... |
|---|---|
| Error Monitoring | Always — non-negotiable baseline |
| Tracing | Always for React SPAs — page load + navigation spans are high-value |
| Session Replay | User-facing app, login flows, or checkout pages |
| Logging | App needs structured log search or log-to-trace correlation |
| Profiling | Performance-critical app; server sends |
React-specific extras:
- React 19 detected → set up on
reactErrorHandler()createRoot - React Router detected → configure matching router integration (see Phase 3)
- Redux detected → add to Redux store
createReduxEnhancer() - Vite detected → configure for source maps (essential for readable stack traces)
sentryVitePlugin
Propose: "I recommend setting up Error Monitoring + Tracing + Session Replay. Want me to also add Logging or Profiling?"
根据项目检测结果给出具体建议,避免开放式问题,直接提供方案:
推荐配置(核心覆盖):
- ✅ 错误监控 —— 必选;捕获未处理错误、React错误边界、React 19钩子错误
- ✅ 链路追踪 —— React单页应用必备,覆盖页面加载、导航和API调用追踪
- ✅ 会话重放 —— 面向用户的应用推荐配置,可记录错误发生前后的会话内容
可选配置(增强可观测性):
- ⚡ 日志功能 —— 通过实现结构化日志;当需要结构化日志搜索时推荐配置
Sentry.logger.* - ⚡ 性能分析 —— 基于JS Self-Profiling API(⚠️ 实验性功能;需要跨源隔离头)
推荐逻辑:
| 功能 | 推荐场景 |
|---|---|
| 错误监控 | 必选 —— 基础监控能力,不可或缺 |
| 链路追踪 | React单页应用必选 —— 页面加载和导航链路的价值极高 |
| 会话重放 | 面向用户的应用、登录流程或结账页面 |
| 日志功能 | 应用需要结构化日志搜索或日志与链路关联 |
| 性能分析 | 性能敏感型应用;服务器需发送 |
React专属增强配置:
- 检测到React 19 → 在上配置
createRootreactErrorHandler() - 检测到React Router → 配置对应的路由集成(见阶段三)
- 检测到Redux → 为Redux Store添加
createReduxEnhancer() - 检测到Vite → 配置生成Source Maps(这是生成可读堆栈跟踪的关键)
sentryVitePlugin
建议话术:「我建议配置错误监控 + 链路追踪 + 会话重放。是否需要同时添加日志功能或性能分析?」
Phase 3: Guide
阶段三:分步引导
Install
安装SDK
bash
npm install @sentry/react --savebash
npm install @sentry/react --saveCreate src/instrument.ts
src/instrument.ts创建src/instrument.ts
文件
src/instrument.tsSentry must initialize before any other code runs. Put in a dedicated sidecar file:
Sentry.init()typescript
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN, // Adjust per build tool (see table below)
environment: import.meta.env.MODE,
release: import.meta.env.VITE_APP_VERSION, // inject at build time
sendDefaultPii: true,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
],
// Tracing
tracesSampleRate: 1.0, // lower to 0.1–0.2 in production
tracePropagationTargets: ["localhost", /^https:\/\/yourapi\.io/],
// Session Replay
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
enableLogs: true,
});DSN environment variable by build tool:
| Build Tool | Variable Name | Access in code |
|---|---|---|
| Vite | | |
| Create React App | | |
| Custom webpack | | |
Sentry必须在所有其他代码运行前初始化。将放在独立的初始化文件中:
Sentry.init()typescript
import * as Sentry from "@sentry/react";
Sentry.init({
dsn: import.meta.env.VITE_SENTRY_DSN, // 根据构建工具调整(见下表)
environment: import.meta.env.MODE,
release: import.meta.env.VITE_APP_VERSION, // 构建时注入版本号
sendDefaultPii: true,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: true,
blockAllMedia: true,
}),
],
// 链路追踪配置
tracesSampleRate: 1.0, // 生产环境建议调低至0.1–0.2
tracePropagationTargets: ["localhost", /^https:\/\/yourapi\.io/],
// 会话重放配置
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
enableLogs: true,
});不同构建工具的DSN环境变量:
| 构建工具 | 变量名称 | 代码中获取方式 |
|---|---|---|
| Vite | | |
| Create React App | | |
| 自定义webpack | | |
Entry Point Setup
入口文件配置
Import as the very first import in your entry file:
instrument.tstsx
// src/main.tsx (Vite) or src/index.tsx (CRA/webpack)
import "./instrument"; // ← MUST be first
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>
);在入口文件中第一个导入:
instrument.tstsx
// src/main.tsx (Vite) 或 src/index.tsx (CRA/webpack)
import "./instrument"; // ← 必须是第一个导入
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>
);React Version-Specific Error Handling
不同React版本的错误处理
React 19+ — use on :
reactErrorHandler()createRoottsx
import { reactErrorHandler } from "@sentry/react";
createRoot(document.getElementById("root")!, {
onUncaughtError: reactErrorHandler(),
onCaughtError: reactErrorHandler(),
onRecoverableError: reactErrorHandler(),
}).render(<App />);React <19 — wrap your app in :
Sentry.ErrorBoundarytsx
import * as Sentry from "@sentry/react";
createRoot(document.getElementById("root")!).render(
<Sentry.ErrorBoundary fallback={<p>Something went wrong</p>} showDialog>
<App />
</Sentry.ErrorBoundary>
);Use for any sub-tree that should catch errors independently (route sections, widgets, etc.).
<Sentry.ErrorBoundary>React 19+ —— 在上使用:
createRootreactErrorHandler()tsx
import { reactErrorHandler } from "@sentry/react";
createRoot(document.getElementById("root")!, {
onUncaughtError: reactErrorHandler(),
onCaughtError: reactErrorHandler(),
onRecoverableError: reactErrorHandler(),
}).render(<App />);React <19 —— 用包裹应用:
Sentry.ErrorBoundarytsx
import * as Sentry from "@sentry/react";
createRoot(document.getElementById("root")!).render(
<Sentry.ErrorBoundary fallback={<p>出现了一些问题</p>} showDialog>
<App />
</Sentry.ErrorBoundary>
);对于需要独立捕获错误的子组件树(如路由模块、小组件等),也可以使用包裹。
<Sentry.ErrorBoundary>Router Integration
路由集成配置
Configure the matching integration for your router:
| Router | Integration | Notes |
|---|---|---|
| React Router v7 | | |
| React Router v6 | | |
| React Router v5 | | Wrap routes in |
| TanStack Router | | Pass router instance — no hooks required |
| No router / custom | | Names transactions by URL path |
React Router v6/v7 setup:
typescript
// in instrument.ts integrations array:
import React from "react";
import {
createRoutesFromChildren, matchRoutes,
useLocation, useNavigationType,
} from "react-router-dom"; // or "react-router" for v7
import * as Sentry from "@sentry/react";
import { reactRouterV6BrowserTracingIntegration } from "@sentry/react";
import { createBrowserRouter } from "react-router-dom";
// Option A — createBrowserRouter (recommended for v6.4+):
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);
const router = sentryCreateBrowserRouter([...routes]);
// Option B — createBrowserRouter for React Router v7:
// const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV7(createBrowserRouter);
// Option C — integration with hooks (v6 without data APIs):
Sentry.init({
integrations: [
reactRouterV6BrowserTracingIntegration({
useEffect: React.useEffect,
useLocation,
useNavigationType,
matchRoutes,
createRoutesFromChildren,
}),
],
});TanStack Router setup:
typescript
import { tanstackRouterBrowserTracingIntegration } from "@sentry/react";
// Pass your TanStack router instance:
Sentry.init({
integrations: [tanstackRouterBrowserTracingIntegration(router)],
});根据使用的路由库配置对应的集成:
| 路由库 | 集成方案 | 说明 |
|---|---|---|
| React Router v7 | | 需要从 |
| React Router v6 | | 需要从 |
| React Router v5 | | 用 |
| TanStack Router | | 传入TanStack Router实例 —— 无需钩子 |
| 无路由/自定义路由 | | 根据URL路径命名事务 |
React Router v6/v7配置:
typescript
// 在instrument.ts的integrations数组中配置:
import React from "react";
import {
createRoutesFromChildren, matchRoutes,
useLocation, useNavigationType,
} from "react-router-dom"; // v7版本从"react-router"导入
import * as Sentry from "@sentry/react";
import { reactRouterV6BrowserTracingIntegration } from "@sentry/react";
import { createBrowserRouter } from "react-router-dom";
// 方案A —— createBrowserRouter(v6.4+推荐):
const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);
const router = sentryCreateBrowserRouter([...routes]);
// 方案B —— React Router v7的createBrowserRouter:
// const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouterV7(createBrowserRouter);
// 方案C —— 钩子集成(v6无数据API版本):
Sentry.init({
integrations: [
reactRouterV6BrowserTracingIntegration({
useEffect: React.useEffect,
useLocation,
useNavigationType,
matchRoutes,
createRoutesFromChildren,
}),
],
});TanStack Router配置:
typescript
import { tanstackRouterBrowserTracingIntegration } from "@sentry/react";
// 传入你的TanStack Router实例:
Sentry.init({
integrations: [tanstackRouterBrowserTracingIntegration(router)],
});Redux Integration (when detected)
Redux集成(检测到Redux时)
typescript
import * as Sentry from "@sentry/react";
import { configureStore } from "@reduxjs/toolkit";
const store = configureStore({
reducer: rootReducer,
enhancers: (getDefaultEnhancers) =>
getDefaultEnhancers().concat(Sentry.createReduxEnhancer()),
});typescript
import * as Sentry from "@sentry/react";
import { configureStore } from "@reduxjs/toolkit";
const store = configureStore({
reducer: rootReducer,
enhancers: (getDefaultEnhancers) =>
getDefaultEnhancers().concat(Sentry.createReduxEnhancer()),
});Source Maps Setup (strongly recommended)
Source Maps配置(强烈推荐)
Without source maps, stack traces show minified code. Set up the build plugin to upload source maps automatically:
Vite ():
vite.config.tstypescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
export default defineConfig({
build: { sourcemap: "hidden" },
plugins: [
react(),
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});Add to (never commit):
.envbash
SENTRY_AUTH_TOKEN=sntrys_...
SENTRY_ORG=my-org-slug
SENTRY_PROJECT=my-project-slugCreate React App (via CRACO):
bash
npm install @craco/craco @sentry/webpack-plugin --save-devjavascript
// craco.config.js
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
module.exports = {
webpack: {
plugins: {
add: [
sentryWebpackPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
},
},
};没有Source Maps的话,堆栈跟踪会显示压缩后的代码。配置构建插件自动上传Source Maps:
Vite():
vite.config.tstypescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
export default defineConfig({
build: { sourcemap: "hidden" },
plugins: [
react(),
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
});添加到文件(请勿提交到版本库):
.envbash
SENTRY_AUTH_TOKEN=sntrys_...
SENTRY_ORG=my-org-slug
SENTRY_PROJECT=my-project-slugCreate React App(通过CRACO):
bash
npm install @craco/craco @sentry/webpack-plugin --save-devjavascript
// craco.config.js
const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
module.exports = {
webpack: {
plugins: {
add: [
sentryWebpackPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
},
},
};For Each Agreed Feature
逐个功能配置
Walk through features one at a time. Load the reference file, follow its steps, verify before moving on:
| Feature | Reference | Load when... |
|---|---|---|
| Error Monitoring | | Always (baseline) |
| Tracing | | SPA navigation / API call tracing |
| Session Replay | | User-facing app |
| Logging | | Structured log search / log-to-trace |
| Profiling | | Performance-critical app |
| React Features | | Redux, component tracking, source maps, integrations catalog |
For each feature: , follow steps exactly, verify it works.
Read ${SKILL_ROOT}/references/<feature>.md逐个完成功能配置,每个功能都要参考对应文档,严格按照步骤操作并验证:
| 功能 | 参考文档 | 触发场景 |
|---|---|---|
| 错误监控 | | 必选(基础功能) |
| 链路追踪 | | 单页应用导航/API调用追踪 |
| 会话重放 | | 面向用户的应用 |
| 日志功能 | | 结构化日志搜索/日志与链路关联 |
| 性能分析 | | 性能敏感型应用 |
| React专属功能 | | Redux、组件追踪、Source Maps、集成目录 |
每个功能的配置流程:阅读,严格按照步骤操作,验证功能正常运行。
${SKILL_ROOT}/references/<feature>.mdConfiguration Reference
配置参考
Key Sentry.init()
Options
Sentry.init()Sentry.init()
关键配置项
Sentry.init()| Option | Type | Default | Notes |
|---|---|---|---|
| | — | Required. SDK disabled when empty |
| | | e.g., |
| | — | e.g., |
| | | Includes IP addresses and request headers |
| | — | 0–1; |
| | — | Per-transaction sampling; overrides rate |
| | — | Outgoing URLs that receive distributed tracing headers |
| | — | Fraction of all sessions recorded |
| | — | Fraction of error sessions recorded |
| | | Enable |
| | | Stack traces on |
| | | Breadcrumbs stored per event |
| | | Verbose SDK output to console |
| | — | Proxy URL to bypass ad blockers |
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| | — | 必填。为空时SDK会禁用 |
| | | 例如: |
| | — | 例如: |
| | | 包含IP地址和请求头 |
| | — | 0–1;开发环境设为1.0,生产环境设为0.1–0.2 |
| | — | 按事务采样;优先级高于采样率 |
| | — | 接收分布式追踪头的外部URL |
| | — | 录制的会话比例 |
| | — | 错误会话的录制比例 |
| | | 启用 |
| | | 为 |
| | | 每个事件存储的面包屑数量 |
| | | 在控制台输出详细的SDK日志 |
| | — | 代理URL,用于绕过广告拦截器 |
React Compatibility Matrix
React兼容性矩阵
| React Version | Error handling approach | SDK minimum |
|---|---|---|
| React 19+ | | |
| React 16–18 | | |
| React 16 | | |
| React版本 | 错误处理方式 | 最低SDK版本 |
|---|---|---|
| React 19+ | 在 | |
| React 16–18 | 使用 | |
| React 16 | 使用 | |
Verification
验证配置
Trigger test events to confirm Sentry is receiving data:
tsx
// Add a temporary test button anywhere in your app
import * as Sentry from "@sentry/react";
function SentryTest() {
return (
<>
<button onClick={() => { throw new Error("Sentry React test error"); }}>
Test Error
</button>
<button onClick={() => Sentry.captureMessage("Sentry test message", "info")}>
Test Message
</button>
</>
);
}Check the Sentry dashboard:
- Issues → error appears within seconds
- Traces → page load and navigation transactions visible
- Replays → session recording visible after page interaction
- Logs → structured log entries if logging enabled
Set in and check the browser console if nothing appears.
debug: trueSentry.init()触发测试事件确认Sentry是否正常接收数据:
tsx
// 在应用中临时添加测试按钮
import * as Sentry from "@sentry/react";
function SentryTest() {
return (
<>
<button onClick={() => { throw new Error("Sentry React测试错误"); }}>
测试错误上报
</button>
<button onClick={() => Sentry.captureMessage("Sentry测试消息", "info")}>
测试消息上报
</button>
</>
);
}在Sentry控制台检查:
- Issues → 错误会在几秒内出现
- Traces → 可以看到页面加载和导航事务
- Replays → 页面交互后可以看到会话录制内容
- Logs → 如果启用了日志功能,可以看到结构化日志条目
如果没有数据,在中设置并检查浏览器控制台。
Sentry.init()debug: truePhase 4: Cross-Link
阶段四:跨端关联配置
After completing React setup, check for a companion backend missing Sentry coverage:
bash
ls ../backend ../server ../api ../go ../python 2>/dev/null
cat ../go.mod 2>/dev/null | head -3
cat ../requirements.txt ../pyproject.toml 2>/dev/null | head -3
cat ../Gemfile 2>/dev/null | head -3
cat ../pom.xml 2>/dev/null | grep '<artifactId>' | head -3If a backend exists without Sentry configured, suggest the matching skill:
| Backend detected | Suggest skill |
|---|---|
Go ( | |
Python ( | |
Ruby ( | |
Java ( | Use |
| Node.js (Express, Fastify) | Use |
完成React端配置后,检查是否存在未配置Sentry的配套后端:
bash
ls ../backend ../server ../api ../go ../python 2>/dev/null
cat ../go.mod 2>/dev/null | head -3
cat ../requirements.txt ../pyproject.toml 2>/dev/null | head -3
cat ../Gemfile 2>/dev/null | head -3
cat ../pom.xml 2>/dev/null | grep '<artifactId>' | head -3如果存在未配置Sentry的后端,建议使用对应的技能:
| 检测到的后端 | 推荐技能 |
|---|---|
Go( | |
Python( | |
Ruby( | |
Java( | 使用 |
| Node.js(Express、Fastify) | 使用 |
Troubleshooting
故障排查
| Issue | Solution |
|---|---|
| Events not appearing | Set |
| Source maps not working | Build in production mode ( |
| Minified stack traces | Source maps not uploading — check plugin config and auth token |
| Verify it's the first import in entry file before React/app imports |
| React 19 errors not captured | Confirm |
| React <19 errors not captured | Ensure |
Router transactions named | Add router integration matching your router version |
| Check regex escaping; default is |
| Session replay not recording | Confirm |
| Redux actions not in breadcrumbs | Add |
| Ad blockers dropping events | Set |
| High replay storage costs | Lower |
| Profiling not working | Verify |
| 问题 | 解决方案 |
|---|---|
| 事件未上报 | 设置 |
| Source Maps不生效 | 以生产模式构建( |
| 堆栈跟踪显示压缩代码 | Source Maps未上传 —— 检查插件配置和授权令牌 |
| 确认它是入口文件中的第一个导入,早于React和应用代码 |
| React 19错误未捕获 | 确认 |
| React <19错误未捕获 | 确保 |
路由事务名称显示 | 添加与路由版本匹配的路由集成 |
| 检查正则表达式转义;默认仅匹配 |
| 会话重放未录制 | 确认 |
| Redux操作未出现在面包屑中 | 为Store增强器添加 |
| 广告拦截器阻止事件上报 | 设置 |
| 会话重放存储成本过高 | 调低 |
| 性能分析不生效 | 确认文档响应头已设置 |