Commit af3a651
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: f1c7c415f96a6adeb6dde12919983aa9a5a819a41 parent 855d30f commit af3a651
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments