Sentry & React

https://docs.sentry.io/platforms/javascript/guides/react/

https://docs.sentry.io/platforms/javascript/guides/react/components/errorboundary/

Sentry.ErrorBoundary & ErrorBoundary


import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route } from 'react-router-dom';
import { Provider } from 'react-redux';
import history from '@/utils/history';
import app from '@/views/app';
import store from '@/store'; import ErrorBoundary from '@/components/ErrorBoundary'; // sentry
import * as Sentry from '@sentry/browser';
import * as PACKAGE from '../package.json'; Sentry.init({
environment: `${process.env.NODE_ENV === 'production' ? '生产环境' : '测试环境'}`,
// project-name@version, 如 react-web@0.0.1
// release: 'react-web@0.0.1',
release: `${PACKAGE.name}@${PACKAGE.version}`,
dsn: 'https://xxxxxxx@sentry.xgqfrms.xyz//xx',
}); ReactDOM.render(
// <Sentry.ErrorBoundary fallback={ErrorBoundary} showDialog="false">
<Sentry.ErrorBoundary fallback={ErrorBoundary} showDialog>
<Provider store={store}>
<ConfigProvider locale={zh_CN}>
<Router history={history}>
<Route component={app} />
</Router>
</ConfigProvider>
</Provider>
</Sentry.ErrorBoundary>,
// <ErrorBoundary>
// <Provider store={store}>
// <ConfigProvider locale={zh_CN}>
// <Router history={history}>
// <Route component={app} />
// </Router>
// </ConfigProvider>
// </Provider>
// </ErrorBoundary>,
document.getElementById('app')
);

<button onClick={methodDoesNotExist}>Break the world</button>;

refs

Sentry React SourceMaps All In One

https://www.cnblogs.com/xgqfrms/p/14265055.html



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


Sentry & React的更多相关文章

  1. Sentry React SourceMaps All In One

    Sentry React SourceMaps All In One React https://docs.sentry.io/platforms/javascript/guides/react/ h ...

  2. Sentry For React 完整接入详解(2021 Sentry v21.8.x)前方高能预警!三万字,慎入!

    内容源于:https://docs.sentry.io/platforms/javascript/guides/react/ 系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - ...

  3. Sentry(v20.12.1) K8S 云原生架构探索,1分钟上手 JavaScript 性能监控

    系列 Sentry-Go SDK 中文实践指南 一起来刷 Sentry For Go 官方文档之 Enriching Events Snuba:Sentry 新的搜索基础设施(基于 ClickHous ...

  4. Sentry(v20.12.1) K8S 云原生架构探索,JavaScript 性能监控之管理 Transactions

    系列 Sentry-Go SDK 中文实践指南 一起来刷 Sentry For Go 官方文档之 Enriching Events Snuba:Sentry 新的搜索基础设施(基于 ClickHous ...

  5. Sentry 官方 JavaScript SDK 简介与调试指南

    系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - 创建版本 快速使用 Docker 上手 Sentry-CLI - 30 秒上手 Source Maps Sentry For ...

  6. 快速使用 Docker 上手 Sentry-CLI - 玩转 Source Maps 使用 (create-react-app)

    系列 快速使用 Docker 上手 Sentry-CLI - 创建版本 入门 使用 sentry-cli 上传 source maps 时,您需要设置构建系统以创建版本(release)并上传与该版本 ...

  7. python drf+xadmin+react+dva+react-native+sentry+nginx 搭建前后端分离的博客完整平台

    前言: 经过差不多半年的开发,搭建从前端到服务器,实现了前后端分离的一个集PC端.移动端的多端应用,实属不易,今天得空,好好写篇文章,记录这些天的成果.同时也做个分享. 演示网站地址: http:// ...

  8. Sentry 开发者贡献指南 - 前端 React Hooks 与虫洞状态管理模式

    系列 Sentry 开发者贡献指南 - 前端(ReactJS生态) Sentry 开发者贡献指南 - 后端服务(Python/Go/Rust/NodeJS) 什么是虫洞状态管理模式? 您可以逃脱的最小 ...

  9. iOS程序员的React Native开发工具集

    本文整理了React Native iOS开发过程中有用的工具.服务.测试.库以及网站等. 工具 你可以选择不同的开发环境:DECO.EXPO或者你可以使用Nuclide+Atom,目前我使用EXPO ...

随机推荐

  1. Go Concurrency Patterns: Pipelines and cancellation

    https://blog.golang.org/pipelines Go Concurrency Patterns: Pipelines and cancellation Sameer Ajmani1 ...

  2. SVN 常见问题及解决方法

    1.已跳过 'XXX' -- 节点处于冲突状态 解决方法:cd 进入到出错文件夹或文件所在目录,执行: svn resolved ./文件名(文件夹名)

  3. 一文带你看遍 JDK9~14 的重要新特性!

    Java9 发布于 2017 年 9 月 21 日 .作为 Java8 之后 3 年半才发布的新版本,Java 9 带 来了很多重大的变化其中最重要的改动是 Java 平台模块系统的引入,其他还有诸如 ...

  4. hashCode、equals详解

    hash和hash表是什么? hash是一个函数,该函数中的实现就是一种算法,就是通过一系列的算法来得到一个hash值,这个时候,我们就需要知道另一个东西,hash表,通过hash算法得到的hash值 ...

  5. BPF CO-RE 示例代码解析

    BPF CO-RE 示例代码解析 在BPF的可移植性和CO-RE一文的末尾提到了一个名为runqslower的工具,该工具用于展示在CPU run队列中停留的时间大于某一值的任务.现在以该工具来展示如 ...

  6. VS CODE远程办公篇一

    作者:良知犹存 转载授权以及围观:欢迎添加微信:becom_me 总述     因为疫情的来临,让远程办公变得原来越火.这次我也是盯上了这个功能,实现在家里远程配置电脑. 嵌入式Linux开发的程序员 ...

  7. 在Android用vulkan完成蓝绿幕扣像

    效果图(1080P处理) 因为摄像头开启自动曝光,画面变动时,亮度变化导致扣像在转动时如上. 源码地址vulkan_extratest 这个demo主要测试二点,一是测试ndk camera集成效果, ...

  8. POJ-3208 Apocalypse Someday (数位DP)

    只要某数字的十进制表示中有三个6相邻,则该数字为魔鬼数,求第X小的魔鬼数\(X\le 5e7\) 这一类题目可以先用DP进行预处理,再基于拼凑思想,用"试填法"求出最终的答案 \( ...

  9. Educational Codeforces Round 43

    Educational Codeforces Round 43  A. Minimum Binary Number 显然可以把所有\(1\)合并成一个 注意没有\(1\)的情况 view code / ...

  10. AtCoder Beginner Contest 173

    比赛链接:https://atcoder.jp/contests/abc173/tasks A - Payment 题意 计算只用 $1000$ 元支付某个价格 $n$ 的找零是多少. 代码 #inc ...