angularfire
angularfire copied to clipboard
storage.ref list and listAll returning no result
Version info
Angular: 14.1.3
Firebase: 9.9.0 (same after upgrade to 9.9.3)
AngularFire: 7.4.1
Other (e.g. Ionic/Cordova, Node, browser, operating system):
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
- Inject AngularFireStorage to your angular component
- upload a file via AngularFireStorage to make sure angularfire is working
- call list or listAll, check the result, it's always empty
import { AngularFireStorage } from '@angular/fire/compat/storage';
...
constructor(private storage: AngularFireStorage) {}
....
const ref = this.storage.ref('');
// ref.listAll()
ref.list()
.subscribe((data) => {
console.log(data);
data.items.forEach((element) => {
console.log(element);
});
});
Sample data and security rules
Debug output
** Errors in the JavaScript console **
No Error
** Output from firebase.database().enableLogging(true);
**
** Screenshots **
Expected behavior
Return list of files
Actual behavior
Return no item
Update:
Seems issue is related to some bad folders. when I remove this folder I am able to get the files