Skip to content

🐛 [firebase_auth] FirebaseAuth useEmulator crashes on web #5096

Closed
@pxsanghyo

Description

@pxsanghyo

Bug report

Describe the bug
FirebaseAuth.instance.useEmulator('') crashes on web.

Steps to reproduce

Steps to reproduce the behavior:

  1. Upgrade package to firebase_auth: ^0.20.1
  2. Upgrade firebase sdk to 8.2.4 or higher
  3. Add FirebaseAuth.instance.useEmulator('')
  4. flutter run -d chrome

Expected behavior

Should run on web as well. Android and iOS works fine.


Additional context

The error message on web:

WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production
credentials.
Error: [firebase_auth/unknown] An unknown error occurred: TypeError: Cannot read property 'then' of undefined
    at Object.throw_ [as throw] (http://localhost:50231/dart_sdk.js:5331:11)
    at firebase_auth_web.FirebaseAuthWeb.new.useEmulator
    (http://localhost:50231/packages/firebase_auth_web/firebase_auth_web.dart.lib.js:313:21)
    at useEmulator.throw (<anonymous>)
    at http://localhost:50231/dart_sdk.js:39035:38
    at _RootZone.runBinary (http://localhost:50231/dart_sdk.js:38891:58)
    at _FutureListener.thenAwait.handleError (http://localhost:50231/dart_sdk.js:33884:48)
    at handleError (http://localhost:50231/dart_sdk.js:34448:51)
    at Function._propagateToListeners (http://localhost:50231/dart_sdk.js:34474:17)
    at _Future.new.[_completeError] (http://localhost:50231/dart_sdk.js:34320:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:50231/dart_sdk.js:34359:31)
    at Object._microtaskLoop (http://localhost:50231/dart_sdk.js:39173:13)
    at _startMicrotaskLoop (http://localhost:50231/dart_sdk.js:39179:13)
    at http://localhost:50231/dart_sdk.js:34686:9

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
flutter doctor
Doctor summary (to see all details, run
flutter doctor -v):
[✓] Flutter (Channel beta, 1.26.0-17.6.pre, on
    macOS 11.2.1 20D74 darwin-x64, locale en)
[✓] Android toolchain - develop for Android
    devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio
[✓] Android Studio (version 4.1)
[✓] Connected device (3 available)

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.12.0-259.12.beta
Flutter SDK 1.26.0-17.6.pre

dependencies:
- bloc 6.1.1 [meta]
- cloud_firestore 0.16.0+1 [flutter meta quive
r firebase_core firebase_core_platform_interfa
ce cloud_firestore_platform_interface cloud_fi
restore_web]
- cupertino_icons 1.0.2
- dartz 0.9.2
- firebase_analytics 7.0.1 [meta flutter fireb
ase_core firebase_analytics_web firebase_analy
tics_platform_interface]
- firebase_auth 0.20.1 [meta firebase_core fir
ebase_core_platform_interface firebase_auth_pl
atform_interface firebase_auth_web flutter]
- firebase_core 0.7.0 [firebase_core_platform_
interface flutter quiver meta firebase_core_we
b]
- firebase_crashlytics 0.4.0+1 [flutter stack_
trace firebase_core firebase_core_platform_int
erface firebase_crashlytics_platform_interface
]
- firebase_dynamic_links 0.7.0+1 [flutter fire
base_core]
- firebase_performance 0.5.0+1 [flutter fireba
se_core]
- flutter 0.0.0 [characters collection meta ty
ped_data vector_math sky_engine]
- flutter_bloc 6.1.2 [flutter bloc provider]
- flutter_platform_widgets 0.80.0-beta.0 [flut
ter]
- freezed_annotation 0.12.0 [collection json_a
nnotation meta]
- get_it 5.0.6 [async meta]
- google_fonts 1.1.2 [flutter http path_provid
er crypto]
- hive 1.4.4+1 [meta crypto]
- hive_flutter 0.3.1 [flutter hive path_provid
er path]
- injectable 1.1.0 [get_it]

dev dependencies:
- build_runner 1.11.1 [args async build build_
config build_daemon build_resolvers build_runn
er_core code_builder collection crypto dart_st
yle glob graphs http_multi_server io js loggin
g meta mime path pedantic pool pub_semver pubs
pec_parse shelf shelf_web_socket stack_trace s
tream_transform timing watcher web_socket_chan
nel yaml]
- flutter_launcher_icons 0.9.0 [image args yam
l path]
- flutter_test 0.0.0 [flutter test_api path fa
ke_async clock stack_trace vector_math async b
oolean_selector characters charcode collection
 matcher meta source_span stream_channel strin
g_scanner term_glyph typed_data]
- freezed 0.12.7 [analyzer build build_config
meta source_gen freezed_annotation]
- injectable_generator 1.1.0 [build source_gen
 path glob analyzer meta code_builder dart_sty
le injectable collection]
- integration_test 0.9.2+2 [flutter flutter_dr
iver flutter_test path vm_service archive args
 async boolean_selector characters charcode cl
ock collection convert crypto fake_async file
matcher meta source_span stack_trace stream_ch
annel string_scanner sync_http term_glyph test
_api typed_data vector_math webdriver]

dependency overrides:
- flutter_launcher_icons 0.9.0 [image args yam
l path]

transitive dependencies:
- _fe_analyzer_shared 12.0.0 [meta]
- analyzer 0.40.6 [_fe_analyzer_shared args cl
i_util collection convert crypto glob meta pac
kage_config path pub_semver source_span watche
r yaml]
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.5.0 [collection]
- boolean_selector 2.1.0 [source_span string_s
canner]
- build 1.6.2 [analyzer async convert crypto g
lob logging meta path]
- build_config 0.4.5 [checked_yaml json_annota
tion meta path pubspec_parse yaml]
- build_daemon 2.1.8 [built_collection built_v
alue http_multi_server logging pedantic path p
ool shelf shelf_web_socket stream_transform wa
tcher web_socket_channel]
- build_resolvers 1.5.3 [analyzer build crypto
 graphs logging meta path package_config pool
pub_semver]
- build_runner_core 6.1.7 [async build build_c
onfig build_resolvers collection convert crypt
o glob graphs logging meta path package_config
 pedantic pool timing watcher yaml]
- built_collection 5.0.0
- built_value 8.0.0 [built_collection collecti
on fixnum]
- characters 1.1.0
- charcode 1.2.0
- checked_yaml 1.0.4 [json_annotation source_s
pan yaml]
- cli_util 0.2.0 [path]
- clock 1.1.0
- cloud_firestore_platform_interface 3.0.2 [fl
utter meta collection firebase_core plugin_pla
tform_interface]
- cloud_firestore_web 0.3.0+2 [flutter flutter
_web_plugins http_parser meta firebase_core fi
rebase_core_web cloud_firestore_platform_inter
face js]
- code_builder 3.6.0 [built_collection built_v
alue collection matcher meta]
- collection 1.15.0
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- dart_style 1.3.10 [analyzer args path source
_span]
- fake_async 1.2.0 [clock collection]
- ffi 0.1.3
- file 6.0.0 [meta path]
- firebase 7.3.3 [http http_parser js]
- firebase_analytics_platform_interface 1.0.3
[flutter meta]
- firebase_analytics_web 0.1.1 [flutter flutte
r_web_plugins firebase firebase_analytics_plat
form_interface meta]
- firebase_auth_platform_interface 3.1.0 [flut
ter meta firebase_core plugin_platform_interfa
ce]
- firebase_auth_web 0.3.3 [flutter flutter_web
_plugins meta http_parser intl firebase_core f
irebase_core_web firebase_auth_platform_interf
ace js]
- firebase_core_platform_interface 3.0.1 [flut
ter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.1+3 [firebase_core_pla
tform_interface flutter flutter_web_plugins me
ta js]
- firebase_crashlytics_platform_interface 1.1.
6 [flutter meta collection firebase_core plugi
n_platform_interface]
- fixnum 1.0.0
- flutter_driver 0.0.0 [file meta path vm_serv
ice webdriver flutter flutter_test fuchsia_rem
ote_debug_protocol archive args async boolean_
selector characters charcode clock collection
convert crypto fake_async matcher platform pro
cess source_span stack_trace stream_channel st
ring_scanner sync_http term_glyph test_api typ
ed_data vector_math]
- flutter_web_plugins 0.0.0 [flutter js charac
ters collection meta typed_data vector_math]
- fuchsia_remote_debug_protocol 0.0.0 [process
 vm_service file meta path platform]
- glob 1.2.0 [async collection node_io path pe
dantic string_scanner]
- graphs 0.2.0
- http 0.12.2 [http_parser path pedantic]
- http_multi_server 2.2.0 [async]
- http_parser 3.1.4 [charcode collection sourc
e_span string_scanner typed_data]
- image 2.1.19 [archive xml meta]
- intl 0.16.1 [path]
- io 0.3.4 [charcode meta path string_scanner]
- js 0.6.3
- json_annotation 3.1.1
- logging 1.0.0
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- mime 1.0.0
- nested 1.0.0 [flutter]
- node_interop 1.2.1 [js]
- node_io 1.1.1 [node_interop path]
- package_config 1.9.3 [path charcode]
- path 1.8.0
- path_provider 1.6.27 [flutter path_provider_
platform_interface path_provider_macos path_pr
ovider_linux path_provider_windows]
- path_provider_linux 0.0.1+2 [path xdg_direct
ories path_provider_platform_interface flutter
]
- path_provider_macos 0.0.4+8 [flutter]
- path_provider_platform_interface 1.0.4 [flut
ter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+3 [path_provider
_platform_interface meta path flutter ffi win3
2]
- pedantic 1.10.0
- petitparser 3.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 1.0.3 [meta]
- pool 1.5.0 [async stack_trace]
- process 4.0.0 [file path platform]
- provider 4.3.3 [collection flutter nested]
- pub_semver 1.4.4 [collection]
- pubspec_parse 0.1.8 [checked_yaml json_annot
ation pub_semver yaml]
- quiver 2.1.5 [matcher meta]
- shelf 0.7.9 [async collection http_parser pa
th stack_trace stream_channel]
- shelf_web_socket 0.2.4+1 [shelf stream_chann
el web_socket_channel]
- sky_engine 0.0.99
- source_gen 0.9.10+2 [analyzer async build da
rt_style glob meta path pedantic source_span]
- source_span 1.8.0 [charcode collection path
term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.0 [charcode source_span]
- sync_http 0.2.0
- term_glyph 1.2.0
- test_api 0.2.19 [async boolean_selector coll
ection meta path source_span stack_trace strea
m_channel string_scanner term_glyph matcher]
- timing 0.1.1+3 [json_annotation]
- typed_data 1.3.0 [collection]
- vector_math 2.1.0
- vm_service 5.5.0 [meta]
- watcher 0.9.7+15 [async path pedantic]
- web_socket_channel 1.2.0 [async crypto strea
m_channel]
- webdriver 2.1.2 [archive matcher path stack_
trace sync_http]
- win32 1.7.4+1 [ffi]
- xdg_directories 0.1.2 [meta path process]
- xml 4.5.1 [collection convert meta petitpars
er]
- yaml 2.2.1 [charcode collection string_scann
er source_span]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions