From 1d23659bb2de0541781fdf5d156749d611e06a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Mon, 6 Jul 2026 03:54:10 -0700 Subject: [PATCH] Fix Fantom REPL crash from metro default import Summary: The Fantom REPL (`yarn fantom-cli`) crashed on startup with `TypeError: Cannot read properties of undefined (reading 'loadConfig')`. `metro` is a CommonJS module that only provides named exports, so the default import `import Metro from 'metro'` resolves to `undefined` under the Babel interop used to run the REPL, and any access such as `Metro.loadConfig` throws. Switch to a namespace import (`import * as Metro from 'metro'`), matching how metro is already imported in the Fantom global setup. Changelog: [Internal] Differential Revision: D110754395 --- private/react-native-fantom/repl/replMetro.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/react-native-fantom/repl/replMetro.js b/private/react-native-fantom/repl/replMetro.js index 00e61c4c0b91..e152b20131ae 100644 --- a/private/react-native-fantom/repl/replMetro.js +++ b/private/react-native-fantom/repl/replMetro.js @@ -11,7 +11,7 @@ import type {Server as HttpServer} from 'http'; import type {Server as HttpsServer} from 'https'; -import Metro from 'metro'; +import * as Metro from 'metro'; import {mergeConfig} from 'metro-config'; import {Server as NetServer} from 'net'; import path from 'path';