Fix Fantom REPL crash from metro default import (#57443)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57443

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]

___

Reviewed By: javache

Differential Revision: D110754395

fbshipit-source-id: f1c7c415f96a6adeb6dde12919983aa9a5a819a4
This commit is contained in:
Rubén Norte authored and meta-codesync[bot] committed 2026-07-06 04:29:55 -07:00
1 parent 855d30f1ad
commit af3a6519b3
1 file changed
+1 -1
+1 -1
View File
@@ -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';