`assert` in `verifyRootExists` doesn't test whether root actually exists
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?
Bug
What is the current behavior?
If root does not exist an error is thrown and the assert doesn't fire.
For libs like expo which use run react-native as a child process, they only print the error message and not the stack trace.
assert(fs.statSync(root).isDirectory(), 'Root has to be a valid directory');
What is the expected behavior?
A separate assert should check whether the root exists, and print a helpful message
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/metro/src/Bundler/index.js at verifyRootExists and inspect how a missing root is handled before the directory check. Reproduce the case with a nonexistent root and verify that the resulting message is helpful; done means the missing-root condition is reported separately from an invalid directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100