firebase / firebase/firebase-tools
Firebase Hosting does not respect Glob pattern
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
### [REQUIRED] Environment info
**firebase-tools:** 13.1.0
**Platform:** macOS, Ubuntu
### [REQUIRED] Test case
```bash
# Step 1: Create a new directory
mkdir my-firebase-project
cd my-firebase-project
# Step 2: Initialize Firebase (assumes Firebase CLI is installed)
firebase init hosting
# During the Firebase init process, you'll need to:
# - Select an existing project or create a new one
# - Configure as a single-page app (rewrite all urls to /index.html): Yes
# - Set up automatic builds and deploys with GitHub: No
# Step 3: Set firebase.json configuration
{
"hosting": {
"target": "app",
"ignore": [],
"rewrites": [
{
"source": "!{/assets/**,/api/**}",
"destination": "/index.html"
}
]
}
}
# Step 4: Deploy to Firebase Hosting
firebase deploy --only hosting
```
### [REQUIRED] Steps to reproduce
Available above^
### [REQUIRED] Expected behavior
If I set the glob pattern to be: `!/assets/**` or `!{/assets/**,/api/**}` it should result in a 404 for `/assets/test.json`
(Some libraries expect 404 response code to create a fallback behaviour, and a 200 code makes them crash)
### [REQUIRED] Actual behavior
If I set the glob pattern to be: `!/assets/**` it does result in a 404 for `/assets/test.json`
If I set the glob pattern to be: `!{/assets/**,/api/**}` it does *not* result in a 404 for `/assets/test.json`
Contributor guide
Research direction
Start with the firebase.json hosting configuration in the issue and reproduce the behavior using firebase deploy --only hosting. Compare the single-pattern and brace-expanded glob cases for /assets/test.json; done means both configurations return a 404 for that path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, typescript
- Domain
- cli, cloud, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100