firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 916 forks source link

firebase_storage eternal await in useStorageEmulator Flutter #7404

Closed geovaniprodata closed 2 days ago

geovaniprodata commented 2 days ago

[REQUIRED] Environment info

firebase-tools: 13.12.0

Platform: Windows

[REQUIRED] Test case

void main() async {
  var app = await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );

  await FirebaseAuth.instance.useAuthEmulator('localhost', 9099);
  await FirebaseStorage.instance.useStorageEmulator('localhost', 9199);
  FirebaseFirestore.instance.useFirestoreEmulator('localhost', 8080);
}

Plugins/Packages needed and their currently version in my project

[REQUIRED] Steps to reproduce

  1. Get plugins, set your firebase config in your project, download the emulators.
  2. Start the emulators by firebase emulators:start
  3. Write the code above
  4. Run in Windows
  5. Wait for async complete

[REQUIRED] Expected behavior

All Emulators complete the async.

[REQUIRED] Actual behavior

Except Storage Emulator, the others complete just fine.

Storage Emulator get stuck, can't debug either.

Observations

  1. My firebase.json is already setted right.
  2. Already tried use storage emulator without async, he uses the production instead, so not working
  3. Already tried change port, change host, update firebase-tools, searched in stackoverflow, git and reddit, none specified my problem
aalej commented 2 days ago

Hey @geovaniprodata, thanks for reaching out. Looking through the report it seems like this might be more related to the firebase_storage package. I tried running the application on a different device, like Chrome, and I was able to connect to the Storage emulator. I’m guessing the issue might be with how useStorageEmulator configures the SDK.

Could you try filing an issue to the FlutterFire GitHub repository, as they might be able to look into this. However, if you think that the issue is caused by firebase-tools, feel free to ask this to be re-opened.