You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not an expert in working with the emulators, but in the docs for the storage emulator here it says:
"Using the Admin SDK, only uploading files, downloading files, and modifying file metadata are supported. Other functionality provided by Google Cloud Storage client libraries is not yet available."
I haven't been able to get getFiles() working either, so in my tests I just keep track of what I'm uploading to the emulator, and then check for the existence of each item using the bucket.file(filename).exists() method. Perhaps the getFiles() method just isn't implemented yet for emulator?
[REQUIRED] Environment info
firebase-tools@9.16.0
9.16.0
macOS
[REQUIRED] Test case
const {Storage} = require('@google-cloud/storage');
//use project name
var storage = new Storage({
projectId: projectname,
});
var anyfile = await storage.bucket("default-bucket").getFiles();
[REQUIRED] Steps to reproduce
run firebase functions and firebase storage emulator
add a file to cloud storage emulator
objectis {
kind: '#storage#object',
name: 'result.txt',
bucket: 'default-bucket',
generation: '1626727265697',
metageneration: '1',
...
}
try to get files with firebase function
[REQUIRED] Expected behavior
[
File {
domain:
Domain {
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
members: [],
[Symbol(kWeak)]: WeakReference {} },
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
metadata:
{ kind: 'storage#object',
...
]
[REQUIRED] Actual behavior
nothing returned
[]
(works on production db but not in emulator)
The text was updated successfully, but these errors were encountered: