Skip to content

Commit af3a651

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Fix Fantom REPL crash from metro default import (#57443)
Summary: Pull Request resolved: #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
1 parent 855d30f commit af3a651

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

private/react-native-fantom/repl/replMetro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import type {Server as HttpServer} from 'http';
1212
import type {Server as HttpsServer} from 'https';
1313

14-
import Metro from 'metro';
14+
import * as Metro from 'metro';
1515
import {mergeConfig} from 'metro-config';
1616
import {Server as NetServer} from 'net';
1717
import path from 'path';

0 commit comments

Comments
 (0)