Skip to content

Fix Fantom REPL crash from metro default import#57443

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D110754395
Closed

Fix Fantom REPL crash from metro default import#57443
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:export-D110754395

Conversation

@rubennorte

Copy link
Copy Markdown
Member

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

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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 6, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110754395.

@meta-codesync meta-codesync Bot closed this in af3a651 Jul 6, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been merged in af3a651.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant