Handling of Special Characters in Asset File Names Causes Build Failures
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 696
- Avg merge
- 8m
- Merged PRs (30d)
- 7
Description
Hi there,
I've encountered an issue with Metro where asset file names containing special characters (specifically the ampersand &) cause the build process to fail. An example of this is when using the font file named LCDAT&TPhoneTimeDate.ttf, which required renaming to LCDAT.ttf to resolve the issue.
This seems to be a parsing or handling error related to special characters in file names, which might not be adequately handled or escaped during the build process.
Steps to Reproduce:
- Include a file with an ampersand (
&) in the name, e.g.,LCDAT&TPhoneTimeDate.ttf, in the assets directory. - Run
npx expo start - Wait for iOS bundling to finish
- Observe the error
Expected Behavior:
The build process should handle file names with special characters without failing, or there should be clear documentation on file name restrictions.
Actual Behavior:
The build fails (or behaves unexpectedly), and the file must be renamed to exclude special characters for successful processing.
Is this a known limitation with Metro's file handling, or is this something that can be improved either in functionality or documentation?
Thanks for looking into this!
This issue was prompted by troubleshooting during development, where renaming the file resolved the build issues.
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
Reproduce the failure with an asset named LCDAT&TPhoneTimeDate.ttf and run npx expo start, then trace Metro's asset filename handling during iOS bundling. Done means the asset builds successfully with the ampersand, or the supported filename restrictions are clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100