Skip to content

[firebase_storage] Add Support Web #1972

Closed
@morphingcoffee

Description

@morphingcoffee

Describe the bug
On Flutter Web, StorageReference futures never complete, neither with success or exception.

To Reproduce
Repository ready to reproduce the issue: GitHub

Otherwise, steps to reproduce the behavior:

  1. Switch to flutter master channel & enable web support;
  2. Add dart plugin dependencies:
  • firebase: ^7.0.0
  • firebase_storage: ^3.1.1
  1. Add some firebase_storage code, e.g.:
 var storageChild = FirebaseStorage.instance
      .ref()
      .child("test.png");

  // Requires 2+ calls in order to log error in browser console.
  // Underlying 'await FirebaseStorage.channel.invokeMethod' never completes.
  storageChild.getDownloadURL();
  storageChild.getDownloadURL();
  1. Run for web & see errors in Chrome console:
errors.dart:147 Uncaught (in promise) Error: MissingPluginException(No implementation found for method StorageReference#getDownloadUrl on channel plugins.flutter.io/firebase_storage)
    at Object.throw_ [as throw] (errors.dart:196)
    at MethodChannel._invokeMethod (platform_channel.dart:154)
    at _invokeMethod.next (<anonymous>)
    at onValue (async_patch.dart:47)
    at _RootZone.runUnary (zone.dart:1381)
    at _FutureListener.thenAwait.handleValue (future_impl.dart:140)
...
html_dart2js.dart:38356 Overflow on channel: plugins.flutter.io/firebase_storage.  Messages on this channel are being discarded in FIFO fashion.  The engine may not be running or you need to adjust the buffer size if of the channel.
error @ html_dart2js.dart:38356
_printDebugString @ natives.dart:22
...

Expected behavior

  • Calls to StorageReference methods should complete with either success or failure.
  • FirebaseStorage JavaScript SDK should be found as implementation for StorageReference methods.
  • Firebase Storage messaging channel should not be overflowing

Additional context
Repository ready to reproduce the issue: GitHub. On Javascript level (using JS's firebase.storage() directly) it works perfectly, as you'll see in repository set-up.

Flutter Doctor

[✓] Flutter (Channel master, v1.15.3-pre.37, on Mac OS X 10.15.3 19D76, locale en-GB) • Flutter version 1.15.3-pre.37 at /Users/morphingcoffee/Applications/flutter • Framework revision 6dc3bfaa98 (2 days ago), 2020-02-07 18:28:02 -0800 • Engine revision 6158f03ef5 • Dart version 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at /Users/morphingcoffee/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = /Users/morphingcoffee/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405) ✗ Android license status unknown. Try re-installing or updating your Android SDK Manager. See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.3.1, Build version 11C504 • CocoaPods version 1.8.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 43.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available) • Chrome • chrome • web-javascript • Google Chrome 80.0.3987.87 • Web Server • web-server • web-javascript • Flutter Tools

flutter run -d chrome -v available here

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact: crowdAffects many people, though not necessarily a specific customer with an assigned label. (P2)platform: webIssues / PRs which are specifically for web.plugin: storagetype: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions