react / react/metro

Metro should warn when a metro.config.js file is not found and we fall back to an empty stub

Open
#589 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.6k
Forks
696
Avg merge
8m
Merged PRs (30d)
7

Description

Do you want to request a feature or report a bug?
feature

What is the current behavior?
when a metro.config.js file is not found (at the root of the project), an empty config is used and given a fake name metro.config.stub.js. All of this happens silently so you don't know that you misplaced your metro.config.js and metro isn't even using it.

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.

What is the expected behavior?
Provide a warning message (maybe in --verbose mode) that says metro.config.js not found, using empty config.

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
metro 0.58
node 12.9.1
npm 6.10.2
yarn 1.22.4
Windows 10 19041

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search Metro's config-loading path for the metro.config.js lookup and the metro.config.stub.js fallback. Confirm how the missing-root-config case is handled, then verify that it reports the requested warning while normal config loading remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.