-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,258 @@ | ||
"use strict"; | ||
exports.id = 45534; | ||
exports.ids = [45534]; | ||
exports.modules = { | ||
|
||
/***/ 29879: | ||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
|
||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ assets: () => (/* binding */ assets), | ||
/* harmony export */ contentTitle: () => (/* binding */ contentTitle), | ||
/* harmony export */ "default": () => (/* binding */ MDXContent), | ||
/* harmony export */ frontMatter: () => (/* binding */ frontMatter), | ||
/* harmony export */ metadata: () => (/* binding */ metadata), | ||
/* harmony export */ toc: () => (/* binding */ toc) | ||
/* harmony export */ }); | ||
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62540); | ||
/* harmony import */ var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43023); | ||
|
||
|
||
const frontMatter = { | ||
id: 'symbolication', | ||
title: 'Symbolicating a stack trace' | ||
}; | ||
const contentTitle = undefined; | ||
const metadata = { | ||
"id": "symbolication", | ||
"title": "Symbolicating a stack trace", | ||
"description": "If a React Native app throws an unhandled exception in a release build, the output may be obfuscated and hard to read:", | ||
"source": "@site/versioned_docs/version-0.70/symbolication.md", | ||
"sourceDirName": ".", | ||
"slug": "/symbolication", | ||
"permalink": "/docs/0.70/symbolication", | ||
"draft": false, | ||
"unlisted": false, | ||
"editUrl": "https://github.com/reactnativecn/react-native-website/blob/production/cnwebsite/../cndocs/symbolication.md", | ||
"tags": [], | ||
"version": "0.70", | ||
"frontMatter": { | ||
"id": "symbolication", | ||
"title": "Symbolicating a stack trace" | ||
}, | ||
"sidebar": "docs", | ||
"previous": { | ||
"title": "调试", | ||
"permalink": "/docs/0.70/debugging" | ||
}, | ||
"next": { | ||
"title": "Testing", | ||
"permalink": "/docs/0.70/testing-overview" | ||
} | ||
}; | ||
const assets = { | ||
|
||
}; | ||
|
||
|
||
|
||
const toc = [{ | ||
"value": "Notes on Sourcemaps", | ||
"id": "notes-on-sourcemaps", | ||
"level": 2 | ||
}]; | ||
function _createMdxContent(props) { | ||
const _components = { | ||
a: "a", | ||
blockquote: "blockquote", | ||
code: "code", | ||
h2: "h2", | ||
li: "li", | ||
p: "p", | ||
pre: "pre", | ||
strong: "strong", | ||
ul: "ul", | ||
...(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .useMDXComponents */ .R)(), | ||
...props.components | ||
}; | ||
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { | ||
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, { | ||
children: "If a React Native app throws an unhandled exception in a release build, the output may be obfuscated and hard to read:" | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.pre, { | ||
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
className: "language-sh", | ||
children: "07-15 10:58:25.820 18979 18998 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules\n07-15 10:58:25.820 18979 18998 E AndroidRuntime: Process: com.awesomeproject, PID: 18979 07-15 10:58:25.820 18979 18998 E AndroidRuntime: com.facebook.react.common.JavascriptException: Failed, js engine: hermes, stack:\n07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132161\n07-15 10:58:25.820 18979 18998 E AndroidRuntime: p@1:132084\n07-15 10:58:25.820 18979 18998 E AndroidRuntime: f@1:131854\n07-15 10:58:25.820 18979 18998 E AndroidRuntime: anonymous@1:131119\n" | ||
}) | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, { | ||
children: ["The sections like ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "p@1:132161" | ||
}), " are minified function names and bytecode offsets. To debug the problem, you would instead want to translate it into file, line and function name: ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "AwesomeProject/App.js:54:initializeMap" | ||
}), ". This is known as ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.strong, { | ||
children: "symbolication." | ||
}), " You can symbolicate minified function names and bytecode like the above by passing ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "metro-symbolicate" | ||
}), " a generated source map and the stack trace."] | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.blockquote, { | ||
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, { | ||
children: ["The ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "metro-symbolicate" | ||
}), " package is installed by default in the React Native template project from ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, { | ||
href: "environment-setup", | ||
children: "setting up your development environment" | ||
}), "."] | ||
}), "\n"] | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, { | ||
children: "From a file containing the stacktrace:" | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.pre, { | ||
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
className: "language-sh", | ||
children: "npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map < stacktrace.txt\n" | ||
}) | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, { | ||
children: ["From ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "adb logcat" | ||
}), "directly:"] | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.pre, { | ||
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
className: "language-sh", | ||
children: "adb logcat -d | npx metro-symbolicate android/app/build/generated/sourcemaps/react/release/index.android.bundle.map\n" | ||
}) | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, { | ||
children: ["This will turn each minified function name and offset like ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "p@1:132161" | ||
}), " into the actual file- and function name ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "AwesomeProject/App.js:54:initializeMap" | ||
}), "."] | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.h2, { | ||
id: "notes-on-sourcemaps", | ||
children: "Notes on Sourcemaps" | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, { | ||
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, { | ||
children: "Multiple source maps may be generated by the build process. Make sure to used the one in the location shown in the examples." | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, { | ||
children: "Make sure that the source map you use corresponds to the exact commit of the crashing app. Small changes in source code can cause large differences in offsets." | ||
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.li, { | ||
children: ["If ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, { | ||
children: "metro-symbolicate" | ||
}), " exits immediately with success, make sure the input comes from a pipe or redirection and not from a terminal."] | ||
}), "\n"] | ||
})] | ||
}); | ||
} | ||
function MDXContent(props = {}) { | ||
const {wrapper: MDXLayout} = { | ||
...(0,_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__/* .useMDXComponents */ .R)(), | ||
...props.components | ||
}; | ||
return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, { | ||
...props, | ||
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, { | ||
...props | ||
}) | ||
}) : _createMdxContent(props); | ||
} | ||
|
||
|
||
|
||
/***/ }), | ||
|
||
/***/ 43023: | ||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | ||
|
||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ R: () => (/* binding */ useMDXComponents), | ||
/* harmony export */ x: () => (/* binding */ MDXProvider) | ||
/* harmony export */ }); | ||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63696); | ||
/** | ||
* @typedef {import('mdx/types.js').MDXComponents} MDXComponents | ||
* @typedef {import('react').Component<{}, {}, unknown>} Component | ||
* @typedef {import('react').ReactNode} ReactNode | ||
*/ | ||
|
||
/** | ||
* @callback MergeComponents | ||
* Custom merge function. | ||
* @param {Readonly<MDXComponents>} currentComponents | ||
* Current components from the context. | ||
* @returns {MDXComponents} | ||
* Additional components. | ||
* | ||
* @typedef Props | ||
* Configuration for `MDXProvider`. | ||
* @property {ReactNode | null | undefined} [children] | ||
* Children (optional). | ||
* @property {Readonly<MDXComponents> | MergeComponents | null | undefined} [components] | ||
* Additional components to use or a function that creates them (optional). | ||
* @property {boolean | null | undefined} [disableParentContext=false] | ||
* Turn off outer component context (default: `false`). | ||
*/ | ||
|
||
|
||
|
||
/** @type {Readonly<MDXComponents>} */ | ||
const emptyComponents = {} | ||
|
||
const MDXContext = react__WEBPACK_IMPORTED_MODULE_0__.createContext(emptyComponents) | ||
|
||
/** | ||
* Get current components from the MDX Context. | ||
* | ||
* @param {Readonly<MDXComponents> | MergeComponents | null | undefined} [components] | ||
* Additional components to use or a function that creates them (optional). | ||
* @returns {MDXComponents} | ||
* Current components. | ||
*/ | ||
function useMDXComponents(components) { | ||
const contextComponents = react__WEBPACK_IMPORTED_MODULE_0__.useContext(MDXContext) | ||
|
||
// Memoize to avoid unnecessary top-level context changes | ||
return react__WEBPACK_IMPORTED_MODULE_0__.useMemo( | ||
function () { | ||
// Custom merge via a function prop | ||
if (typeof components === 'function') { | ||
return components(contextComponents) | ||
} | ||
|
||
return {...contextComponents, ...components} | ||
}, | ||
[contextComponents, components] | ||
) | ||
} | ||
|
||
/** | ||
* Provider for MDX context. | ||
* | ||
* @param {Readonly<Props>} properties | ||
* Properties. | ||
* @returns {JSX.Element} | ||
* Element. | ||
* @satisfies {Component} | ||
*/ | ||
function MDXProvider(properties) { | ||
/** @type {Readonly<MDXComponents>} */ | ||
let allComponents | ||
|
||
if (properties.disableParentContext) { | ||
allComponents = | ||
typeof properties.components === 'function' | ||
? properties.components(emptyComponents) | ||
: properties.components || emptyComponents | ||
} else { | ||
allComponents = useMDXComponents(properties.components) | ||
} | ||
|
||
return react__WEBPACK_IMPORTED_MODULE_0__.createElement( | ||
MDXContext.Provider, | ||
{value: allComponents}, | ||
properties.children | ||
) | ||
} | ||
|
||
|
||
/***/ }) | ||
|
||
}; | ||
; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.