-
-
Notifications
You must be signed in to change notification settings - Fork 914
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
"react-markdown": "10.1.0"
Steps to reproduce
Markdown 组件在安卓的 H5 环境报错 Object.hasOnw is not a function
Actual behavior
Based on the uploaded screenshot of the JavaScript error in an Android H5 environment, here is a precise English translation of the issue description:
Translated Issue Description (for Bug Reporting or Analysis)
Environment Context:
The error occurred in an Android H5 web application, as captured in a mobile screenshot. The device displayed the following status at the time (top status bar):
- Timestamp: 17:02
- Network Speed: 85.0 KB/s
- Battery Level: 73%
Error Type:
TypeError
(categorized as "Error 1 of 2" in the screenshot)
Core Error Message:
Object.hasOwnProperty is not a function
(This indicates an undefined method call on theObject
prototype)
Call Stack Details (from the error panel):
- Initiated at:
post
innode_modules/react-markdown/lib/index.js:340:16
- Followed by:
Markdown
innode_modules/react-markdown/lib/index.js:195:10
- Entered React internals:
renderWithHooks
innode_modules/react-dom/cjs/react-dom.development.js:15486:18
- Subsequent React lifecycle methods:
mountIndeterminateComponent
(react-dom.development.js:20098:13
)beginWork
(react-dom.development.js:21621:16
)- Event handling:
HTMLUnknownElement.callCallback
andinvokeGuardedCallbackDev
(react-dom.development.js:4164:14
and4213:16
)
- Ended with:
performUnitOfWork
(react-dom.development.js:26591:12
)
Visual Context:
- UI layout: Deep gray background with white/red text and yellow/white stack trace lines.
- Bottom controls: "Prev," "Close," and "Next" buttons visible.
Summary in Technical Terms:
A TypeError
in an Android WebView environment due to the absence of Object.hasOwnProperty
implementation in older JavaScript engines. The crash originated in react-markdown
during component rendering, specifically at the renderWithHooks
phase of React. This is consistent with low-compatibility Android WebViews (e.g., Chrome < v93).
This description preserves all critical technical details from the screenshot, including file paths, line numbers, and environmental context, for accurate debugging or reporting. If you need an optimized fix or further analysis based on this translation, let me know!
Expected behavior
normal
Runtime
node@18.20.8
Package manager
npm@10.8.2
Operating system
Android@13
Build and bundle tools
swc