Metro doesn't package ressources when require is aliased in release mode
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?
A bug
What is the current behavior?
When require is aliased, requiring a ressource (for example an image) fails when package RN app in release mode. Aliased requires works in dev mode though...
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.
Simply do that:
var temp1 = require;
// ...
return (
<Image source={temp1("path to pic file")} />
);
What is the expected behavior?
That should work in both release and debug/dev.
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
- OS X 11.1 Big sur
- react-native 0.63.3
- yarn 1.22.10
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
No source files or tests are named. Start by reproducing the aliased require with an image in a release build, then compare Metro's resource handling with dev mode; done means the resource is packaged and loads successfully in both modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- build-system, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100