Skip to content

RCTFatalException: Unhandled JS Exception: TypeError: Cannot read property 'attributes' of undefined, js engine: hermes: Unhandled JS Exception: TypeError: Cannot read property 'attributes' of undefined, js engine: her... #6420

@sentry

Description

@sentry

Sentry Issue: WORDPRESS-IOS-464F

How to reproduce it

  1. Open the app and create a post.
  2. Switch to HTML mode.
  3. Paste the following HTML code:
<div>
<p>Hello world!</p>
</div>
  1. Switch back to Visual mode.
  2. Tap two times on the Classic block to present the bottom sheet.
  3. Tap on Convert to blocks option.
  4. Observe the crash.

Symbolicated stack trace

Unhandled JS Exception: TypeError: Cannot read property 'attributes' of undefined, js engine: hermes, stack:
/workdir/gutenberg/packages/blocks/src/api/parser/get-block-attributes.js:282:getBlockAttributes
/workdir/gutenberg/packages/blocks/src/api/raw-handling/html-to-blocks.js:34:Array.from.flatMap$argument_0
/workdir/gutenberg/packages/blocks/src/api/raw-handling/html-to-blocks.js:24:htmlToBlocks
/workdir/gutenberg/packages/blocks/src/api/raw-handling/index.js:74:pieces.map$argument_0
/workdir/gutenberg/packages/blocks/src/api/raw-handling/index.js:50:rawHandler
/workdir/gutenberg/packages/block-library/src/missing/edit.native.js:255:replaceBlocks
/workdir/gutenberg/packages/data/src/components/use-dispatch/use-dispatch-with-map.js:53:<anonymous>
/workdir/gutenberg/packages/block-library/src/missing/edit.native.js:153:onPress
/workdir/gutenberg/packages/components/src/mobile/bottom-sheet/cell.native.js:179:onCellPress
/workdir/gutenberg/node_modules/react-native/Libraries/Pressability/Pressability.js:758:_performTransitionSideEffects
/workdir/gutenberg/node_modules/react-native/Libraries/Pressability/Pressability.js:695:_receiveSignal
/workdir/gutenberg/node_modules/react-native/Libraries/Pressability/Pressability.js:525:responderEventHandlers.onResponderRelease
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:22:invokeGuardedCallbackImpl
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:40:invokeGuardedCallback
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:53:invokeGuardedCallbackAndCatchFirstError
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:73:executeDispatch
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1125:executeDispatchesAndReleaseTopLevel
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:361:forEachAccumulated
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1160:batchedUpdates$argument_0
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:8457:batchedUpdatesImpl
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1106:batchedUpdates
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1137:_receiveRootNodeIDEvent
/workdir/gutenberg/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1209:ReactNativePrivateInterface.RCTEventEmitter.register$argument_0.receiveTouches
/workdir/gutenberg/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:427:__callFunction
/workdir/gutenberg/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:__guard$argument_0
/workdir/gutenberg/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:__guard
/workdir/gutenberg/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:callFunctionReturnFlushedQueue
Raw stack trace
RCTFatalException: Unhandled JS Exception: TypeError: Cannot read property 'attributes' of undefined, js engine: hermes: Unhandled JS Exception: TypeError: Cannot read property 'attributes' of undefined, js engine: hermes, stack:
anonymous@1:1777652
anonymous@1:1786178
anonymous@1:1786090
anonymous@1:1832789
t@1:1832605
replaceBlocks@1:4210284
anonymous@1:1694947
onPress@1:4209376
onPress@1:2614459
value@1:439629
value@1:439201
onResponderRelease@1:438018
c@1:362991
m@1:363048
v@1:363080
w@1:363212
Le@1:367450
$@1:364719
anonymous@1:367802
Ce@1:425466
Ne@1:367370
Me@1:367643
receiveTouches@1:420353
value@1:169079
anonymous@1:167579
value@1:168525
value@1:167537

  ?, in RCTFatal
  ?, in -[RCTExceptionsManager reportFatal:stack:exceptionId:extraDataAsJSON:]
  ?, in -[RCTExceptionsManager reportException:]
  ?, in -[RCTModuleMethod invokeWithBridge:module:arguments:]
  ?, in facebook::react::invokeInner
...
(13 additional frame(s) were not displayed)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions