Skip to content

Commit 995879c

Browse files
jisoo-hisoometa-codesync[bot]
authored andcommitted
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: 9be6670de1e34952a5b08b4ccd5d9e770e7457f3
1 parent 063c7d5 commit 995879c

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

packages/react-native/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,24 @@ const componentStyles = StyleSheet.create({
164164
paddingRight: 10,
165165
},
166166
frameName: {
167-
fontFamily: Platform.select({android: 'monospace', ios: 'Menlo'}),
167+
fontFamily: Platform.select({
168+
android: 'monospace',
169+
ios: 'Menlo',
170+
macos: 'Menlo',
171+
windows: 'Consolas',
172+
}),
168173
color: LogBoxStyle.getTextColor(1),
169174
fontSize: 14,
170175
includeFontPadding: false,
171176
lineHeight: 18,
172177
},
173178
bracket: {
174-
fontFamily: Platform.select({android: 'monospace', ios: 'Menlo'}),
179+
fontFamily: Platform.select({
180+
android: 'monospace',
181+
ios: 'Menlo',
182+
macos: 'Menlo',
183+
windows: 'Consolas',
184+
}),
175185
color: LogBoxStyle.getTextColor(0.4),
176186
fontSize: 14,
177187
fontWeight: '500',

packages/react-native/Libraries/LogBox/UI/LogBoxInspectorStackFrame.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ const styles = StyleSheet.create({
9090
includeFontPadding: false,
9191
lineHeight: 18,
9292
fontWeight: '400',
93-
fontFamily: Platform.select({android: 'monospace', ios: 'Menlo'}),
93+
fontFamily: Platform.select({
94+
android: 'monospace',
95+
ios: 'Menlo',
96+
macos: 'Menlo',
97+
windows: 'Consolas',
98+
}),
9499
},
95100
location: {
96101
color: LogBoxStyle.getTextColor(0.8),

0 commit comments

Comments
 (0)