Commit 995879c
Fix TypeError in LogBoxInspectorReactFrames on Windows/macOS (#55493)
Summary:
Syncs the Windows and macOS platform variants of LogBoxInspectorReactFrames
with the upstream base file. The platform-specific .windows.js and .macos.js
files were using stale StackFrame property names (frame.fileName, frame.content,
frame.location) that no longer exist. The upstream type now uses frame.file,
frame.methodName, and frame.lineNumber.
This caused TypeError: Cannot read property startsWith of undefined when
the LogBox inspector attempted to render component stack frames, since
frame.fileName is undefined. The error cascaded into a secondary LogBox crash.
Changes:
- frame.fileName to frame.file with null guard
- frame.content to frame.methodName
- frame.location.row to frame.lineNumber
- props.log.componentStack to props.log.getAvailableComponentStack()
(uses symbolicated stack when available)
{F1985363726}
{F1985363658}
```
00005041 02-09 14:15:09:664.59 E [HorizonStandalone] React: { [Error: error generating skybox: It seems like I can't do generations right now, please try again later.]
componentStack: '\n at SelectableSlot (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:477566:15)\n at Suspense (<anonymous>)\nTypeError: Class constructor invoked without new\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at LumaView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:110275:15)\n at RCTScrollContentView (<anonymous>)\n at RCTScrollView (<anonymous>)\nTypeError: Class constructor invoked without new\n at ScrollView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:40707:39)\n at LumaDesktopScrollView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:110496:15)\n at LumaGridLayout (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:378654:15)\n at SelectionGrid (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:477466:15)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at LumaView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:110275:15)\n at LumaDisabledContextProvider (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:106556:15)\n at HSRGenAIAssistantSelectionMessage (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:477281:15)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at LumaView (http://localhost:8081/xplat/js/RKJSModule00005042 02-09 14:15:09:930.73 E [HorizonStandalone] React: { [TypeError: Cannot read property 'startsWith' of undefined]
componentStack: '\n at LogBoxInspectorReactFrames (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:59150:41)\n at RCTScrollContentView (<anonymous>)\n at RCTScrollView (<anonymous>)\nTypeError: Class constructor invoked without new\n at ScrollView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:40707:39)\n at LogBoxInspectorBody (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:58116:29)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at LogBoxInspector (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:57815:21)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\nTypeError: Class constructor invoked without new\nTypeError: Class constructor invoked without new\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at AppContainer (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:37633:39)\n at LogBox(RootComponent) (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:57654:34)',
isComponentError: true } [ReactNativeHostHolder-win.cpp:86]
00005043 02-09 14:15:09:937.02 E [HorizonStandalone] React: { [TypeError: An error was thrown when attempting to render log messages via LogBox.
Cannot read property 'startsWith' of undefined]
componentStack: '\n at LogBoxInspectorReactFrames (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:59150:41)\n at RCTScrollContentView (<anonymous>)\n at RCTScrollView (<anonymous>)\nTypeError: Class constructor invoked without new\n at ScrollView (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:40707:39)\n at LogBoxInspectorBody (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:58116:29)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at LogBoxInspector (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:57815:21)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\nTypeError: Class constructor invoked without new\nTypeError: Class constructor invoked without new\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at RCTView (<anonymous>)\n at View (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:38045:23)\n at AppContainer (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:37633:39)\n at LogBox(RootComponent) (http://localhost:8081/xplat/js/RKJSModules/EntryPoints/Desktop/HorizonEditorBundle.bundle//&platform=windows&dev=true&hot=true&inlineSourceMap=false&excludeSource=true&sourcePaths=url-server&app=com.meta.editor&unstable_transformProfile=hermes-stable&lazy=true:57654:34)',
isComponentError: true } [ReactNativeHostHolder-win.cpp:86]
```
Differential Revision: D92736205
Pulled By: jisoo-hisoo
fbshipit-source-id: 9be6670de1e34952a5b08b4ccd5d9e770e7457f31 parent 063c7d5 commit 995879c
2 files changed
Lines changed: 18 additions & 3 deletions
File tree
- packages/react-native/Libraries/LogBox/UI
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
0 commit comments