Skip to content

fix(plugin-metro): watch project root when metro.config.js is missing - #735

Merged
thymikee merged 2 commits into
callstackincubator:mainfrom
cpruijsen:fix/issue-727
Oct 14, 2026
Merged

thymikee merged 2 commits into
callstackincubator:mainfrom
cpruijsen:fix/issue-727

Conversation

@cpruijsen

Copy link
Copy Markdown
Contributor

Projects without metro.config.js now use Metro's loadConfig in packages/plugin-metro/src/lib/start/loadMetroConfig.ts.
Both no-config paths apply CLI overrides and add projectRoot to watchFolders, so Metro can find index.js.

The modern React Native path calls getDefaultConfig after setFrameworkDefaults registers the framework defaults.
The older API path retains its existing default merge.

Fixes #727.

Both new regression tests fail against the merge-base and pass with the fix.
A complete application or HTTP bundle test was not run.

The no-config branch of loadMetroConfig returned the pre-built default
config directly, so the project root was never added to watchFolders and
bundle requests failed to resolve the entry file. Route that branch
through metro-config's loadConfig so the project root is watched and CLI
options are applied, and re-read the defaults from
@react-native/metro-config so they include the framework defaults
registered through setFrameworkDefaults.
@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

@cpruijsen is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@thymikee
thymikee merged commit 0af07c7 into callstackincubator:main Oct 14, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project created with the Metro bundler has no metro.config.js and cannot bundle

2 participants