Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [firebase_ui_auth] Crash on sign out in web: Unexpected null value #308

Open
1 task done
martinsellergren opened this issue Mar 14, 2024 · 3 comments
Open
1 task done
Labels
auth blocked: customer response Waiting for customer response, e.g. more information was requested. Stale Issue with no recent activity

Comments

@martinsellergren
Copy link

martinsellergren commented Mar 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues and found no duplicates.

What plugin is this bug for?

Firebase UI Auth

What platform(s) does this bug affect?

Web

List of dependencies used.

flutter pub deps -s list
[flutter] f pub deps -s list                                                                                                                                                                                                            main
Dart SDK 3.3.0
Flutter SDK 3.19.1
chat_app 1.0.0+1

dependencies:

  • firebase_auth 4.17.9
    • firebase_auth_platform_interface ^7.1.9
    • firebase_auth_web ^5.10.0
    • firebase_core ^2.27.1
    • firebase_core_platform_interface ^5.0.0
    • flutter any
    • meta ^1.8.0
  • firebase_core 2.27.1
    • firebase_core_platform_interface ^5.0.0
    • firebase_core_web ^2.12.0
    • flutter any
    • meta ^1.8.0
  • firebase_dynamic_links 5.4.18
    • firebase_core ^2.27.1
    • firebase_core_platform_interface ^5.0.0
    • firebase_dynamic_links_platform_interface ^0.2.6+26
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_ui_auth 1.13.1
    • email_validator ^2.1.17
    • firebase_auth ^4.17.5
    • firebase_core ^2.25.4
    • firebase_dynamic_links ^5.4.14
    • firebase_ui_localizations ^1.10.2
    • firebase_ui_oauth ^1.5.1
    • firebase_ui_shared ^1.4.1
    • flutter any
    • flutter_localizations any
    • meta ^1.10.0
  • flutter 0.0.0
    • characters 1.3.0
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.11.0
    • vector_math 2.1.4
    • sky_engine any
  • freezed_annotation 2.4.1
    • collection ^1.15.0
    • json_annotation ^4.6.0
    • meta ^1.7.0
  • imp_router 0.2.1
    • flutter any
    • animations ^2.0.11
    • collection ^1.18.0
    • provider ^6.1.1
    • rxdart ^0.27.7
    • flutter_web_plugins any
    • meta ^1.11.0
  • provider 6.1.2
    • collection ^1.15.0
    • flutter any
    • nested ^1.0.0
  • rxdart 0.27.7
  • state_notifier 1.0.0
    • meta ^1.1.8

dev dependencies:

  • flutter_test 0.0.0
    • flutter any
    • test_api 0.6.1
    • matcher 0.12.16+1
    • path 1.9.0
    • fake_async 1.3.1
    • clock 1.1.1
    • stack_trace 1.11.1
    • vector_math 2.1.4
    • leak_tracker_flutter_testing 2.0.1
    • async 2.11.0
    • boolean_selector 2.1.1
    • characters 1.3.0
    • collection 1.18.0
    • leak_tracker 10.0.0
    • leak_tracker_testing 2.0.1
    • material_color_utilities 0.8.0
    • meta 1.11.0
    • source_span 1.10.0
    • stream_channel 2.1.2
    • string_scanner 1.2.0
    • term_glyph 1.2.1
    • vm_service 13.0.0
  • flutter_lints 3.0.1
    • lints ^3.0.0
  • freezed 2.4.7
    • analyzer >=5.13.0 <7.0.0
    • build ^2.3.1
    • build_config ^1.1.0
    • collection ^1.15.0
    • meta ^1.9.1
    • source_gen ^1.2.3
    • freezed_annotation ^2.4.1
    • json_annotation ^4.6.0
  • build_runner 2.4.8
    • analyzer >=4.4.0 <7.0.0
    • args ^2.0.0
    • async ^2.5.0
    • build >=2.1.0 <2.5.0
    • build_config >=1.1.0 <1.2.0
    • build_daemon ^4.0.0
    • build_resolvers ^2.0.0
    • build_runner_core ^7.2.0
    • code_builder ^4.2.0
    • collection ^1.15.0
    • crypto ^3.0.0
    • dart_style ^2.0.0
    • frontend_server_client ^3.0.0
    • glob ^2.0.0
    • graphs ^2.2.0
    • http_multi_server ^3.0.0
    • io ^1.0.0
    • js >=0.6.3 <0.8.0
    • logging ^1.0.0
    • meta ^1.3.0
    • mime ^1.0.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • pub_semver ^2.0.0
    • pubspec_parse ^1.0.0
    • shelf ^1.0.0
    • shelf_web_socket ^1.0.0
    • stack_trace ^1.10.0
    • stream_transform ^2.0.0
    • timing ^1.0.0
    • watcher ^1.0.0
    • web_socket_channel ^2.0.0
    • yaml ^3.0.0

transitive dependencies:

  • _fe_analyzer_shared 67.0.0
    • meta ^1.9.0
  • _flutterfire_internals 1.3.26
    • collection ^1.0.0
    • firebase_core ^2.27.1
    • firebase_core_platform_interface ^5.0.0
    • flutter any
    • meta ^1.8.0
  • analyzer 6.4.1
    • _fe_analyzer_shared ^67.0.0
    • collection ^1.17.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • meta ^1.11.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pub_semver ^2.1.4
    • source_span ^1.8.0
    • watcher ^1.1.0
    • yaml ^3.0.0
  • animations 2.0.11
    • flutter any
  • args 2.4.2
  • async 2.11.0
    • collection ^1.15.0
    • meta ^1.1.7
  • boolean_selector 2.1.1
    • source_span ^1.8.0
    • string_scanner ^1.1.0
  • build 2.4.1
    • analyzer >=1.5.0 <7.0.0
    • async ^2.5.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • logging ^1.0.0
    • meta ^1.3.0
    • package_config ^2.1.0
    • path ^1.8.0
  • build_config 1.1.1
    • checked_yaml ^2.0.0
    • json_annotation ^4.5.0
    • path ^1.8.0
    • pubspec_parse ^1.0.0
    • yaml ^3.0.0
  • build_daemon 4.0.1
    • built_collection ^5.0.0
    • built_value ^8.1.0
    • crypto ^3.0.3
    • http_multi_server ^3.0.0
    • logging ^1.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • shelf ^1.0.0
    • shelf_web_socket ^1.0.0
    • stream_transform ^2.0.0
    • watcher ^1.0.0
    • web_socket_channel ^2.0.0
  • build_resolvers 2.4.2
    • analyzer >=5.12.0 <7.0.0
    • async ^2.5.0
    • build ^2.0.0
    • collection ^1.17.0
    • convert ^3.1.1
    • crypto ^3.0.0
    • graphs >=1.0.0 <3.0.0
    • logging ^1.0.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • pub_semver ^2.0.0
    • stream_transform ^2.0.0
    • yaml ^3.0.0
  • build_runner_core 7.3.0
    • async ^2.5.0
    • build ^2.4.0
    • build_config ^1.0.0
    • build_resolvers ^2.4.0
    • collection ^1.15.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • graphs ^2.0.0
    • json_annotation ^4.8.1
    • logging ^1.2.0
    • meta ^1.3.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • timing ^1.0.0
    • watcher ^1.0.0
    • yaml ^3.0.0
  • built_collection 5.1.1
  • built_value 8.9.1
    • built_collection ^5.0.0
    • collection ^1.15.0
    • fixnum ^1.0.0
    • meta ^1.3.0
  • characters 1.3.0
  • checked_yaml 2.0.3
    • json_annotation ^4.3.0
    • source_span ^1.8.0
    • yaml ^3.0.0
  • clock 1.1.1
  • code_builder 4.10.0
    • built_collection ^5.0.0
    • built_value ^8.0.0
    • collection ^1.15.0
    • matcher ^0.12.10
    • meta ^1.3.0
  • collection 1.18.0
  • convert 3.1.1
    • typed_data ^1.3.0
  • crypto 3.0.3
    • typed_data ^1.3.0
  • dart_style 2.3.6
    • analyzer ^6.2.0
    • args >=1.0.0 <3.0.0
    • collection ^1.17.0
    • path ^1.0.0
    • pub_semver >=1.4.4 <3.0.0
    • source_span ^1.4.0
  • desktop_webview_auth 0.0.15
    • crypto ^3.0.3
    • flutter any
    • http ^1.0.0
    • flutter_web_plugins any
    • plugin_platform_interface ^2.1.4
  • email_validator 2.1.17
  • fake_async 1.3.1
    • clock ^1.1.0
    • collection ^1.15.0
  • file 7.0.0
    • meta ^1.9.1
    • path ^1.8.3
  • firebase_auth_platform_interface 7.1.9
    • _flutterfire_internals ^1.3.26
    • collection ^1.16.0
    • firebase_core ^2.27.1
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_auth_web 5.10.0
    • firebase_auth_platform_interface ^7.1.9
    • firebase_core ^2.27.1
    • firebase_core_web ^2.12.0
    • flutter any
    • flutter_web_plugins any
    • http_parser ^4.0.0
    • js ^0.6.3
    • meta ^1.8.0
    • web ^0.5.1
  • firebase_core_platform_interface 5.0.0
    • collection ^1.0.0
    • flutter any
    • flutter_test any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_core_web 2.12.0
    • firebase_core_platform_interface ^5.0.0
    • flutter any
    • flutter_web_plugins any
    • js ^0.6.3
    • meta ^1.8.0
    • web ^0.5.1
  • firebase_dynamic_links_platform_interface 0.2.6+26
    • _flutterfire_internals ^1.3.26
    • firebase_core ^2.27.1
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_ui_localizations 1.10.2
    • flutter any
    • flutter_localizations any
    • path ^1.8.3
  • firebase_ui_oauth 1.5.1
    • desktop_webview_auth ^0.0.14
    • firebase_auth ^4.17.5
    • firebase_ui_auth ^1.13.1
    • firebase_ui_shared ^1.4.1
    • flutter_svg ^2.0.9
    • flutter any
  • firebase_ui_shared 1.4.1
    • flutter any
  • fixnum 1.1.0
  • flutter_localizations 0.0.0
    • flutter any
    • intl 0.18.1
    • characters 1.3.0
    • clock 1.1.1
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.11.0
    • path 1.9.0
    • vector_math 2.1.4
  • flutter_svg 2.0.10+1
    • flutter any
    • http ^1.0.0
    • vector_graphics ^1.1.11
    • vector_graphics_codec ^1.1.11
    • vector_graphics_compiler ^1.1.11
  • flutter_web_plugins 0.0.0
    • flutter any
    • characters 1.3.0
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.11.0
    • vector_math 2.1.4
  • frontend_server_client 3.2.0
    • async ^2.5.0
    • path ^1.8.0
  • glob 2.1.2
    • async ^2.5.0
    • collection ^1.15.0
    • file >=6.1.3 <8.0.0
    • path ^1.8.0
    • string_scanner ^1.1.0
  • graphs 2.3.1
    • collection ^1.1.0
  • http 1.2.1
    • async ^2.5.0
    • http_parser ^4.0.0
    • meta ^1.3.0
    • web ^0.5.0
  • http_multi_server 3.2.1
    • async ^2.5.0
  • http_parser 4.0.2
    • collection ^1.15.0
    • source_span ^1.8.0
    • string_scanner ^1.1.0
    • typed_data ^1.3.0
  • intl 0.18.1
    • clock ^1.1.0
    • meta ^1.0.2
    • path ^1.8.0
  • io 1.0.4
    • meta ^1.3.0
    • path ^1.8.0
    • string_scanner ^1.1.0
  • js 0.6.7
    • meta ^1.7.0
  • json_annotation 4.8.1
    • meta ^1.4.0
  • leak_tracker 10.0.0
    • clock ^1.1.1
    • collection ^1.15.0
    • meta ^1.8.0
    • path ^1.8.3
    • vm_service >=11.10.0 <15.0.0
  • leak_tracker_flutter_testing 2.0.1
    • flutter any
    • leak_tracker >=10.0.0 <11.0.0
    • leak_tracker_testing >=2.0.1 <3.0.0
    • matcher ^0.12.16
    • meta ^1.8.0
  • leak_tracker_testing 2.0.1
    • leak_tracker >=9.0.0 <11.0.0
    • matcher ^0.12.16
    • meta ^1.11.0
  • lints 3.0.0
  • logging 1.2.0
  • matcher 0.12.16+1
    • async ^2.10.0
    • meta ^1.8.0
    • stack_trace ^1.10.0
    • term_glyph ^1.2.0
    • test_api >=0.5.0 <0.8.0
  • material_color_utilities 0.8.0
    • collection ^1.15.0
  • meta 1.11.0
  • mime 1.0.5
  • nested 1.0.0
    • flutter any
  • package_config 2.1.0
    • path ^1.8.0
  • path 1.9.0
  • path_parsing 1.0.1
    • vector_math ^2.1.0
    • meta ^1.3.0
  • petitparser 6.0.2
    • meta ^1.9.0
  • plugin_platform_interface 2.1.8
    • meta ^1.3.0
  • pool 1.5.1
    • async ^2.5.0
    • stack_trace ^1.10.0
  • pub_semver 2.1.4
    • collection ^1.15.0
    • meta ^1.3.0
  • pubspec_parse 1.2.3
    • checked_yaml ^2.0.1
    • collection ^1.15.0
    • json_annotation ^4.8.0
    • pub_semver ^2.0.0
    • yaml ^3.0.0
  • shelf 1.4.1
    • async ^2.5.0
    • collection ^1.15.0
    • http_parser ^4.0.0
    • path ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
  • shelf_web_socket 1.0.4
    • shelf ^1.1.0
    • stream_channel ^2.1.0
    • web_socket_channel ^2.0.0
  • sky_engine 0.0.99
  • source_gen 1.5.0
    • analyzer >=5.2.0 <7.0.0
    • async ^2.5.0
    • build ^2.1.0
    • dart_style ^2.0.0
    • glob ^2.0.0
    • path ^1.8.0
    • source_span ^1.8.0
    • yaml ^3.0.0
  • source_span 1.10.0
    • collection ^1.15.0
    • path ^1.8.0
    • term_glyph ^1.2.0
  • stack_trace 1.11.1
    • path ^1.8.0
  • stream_channel 2.1.2
    • async ^2.5.0
  • stream_transform 2.1.0
  • string_scanner 1.2.0
    • source_span ^1.8.0
  • term_glyph 1.2.1
  • test_api 0.6.1
    • async ^2.5.0
    • boolean_selector ^2.1.0
    • collection ^1.15.0
    • meta ^1.3.0
    • source_span ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
    • string_scanner ^1.1.0
    • term_glyph ^1.2.0
  • timing 1.0.1
    • json_annotation ^4.3.0
  • typed_data 1.3.2
    • collection ^1.15.0
  • vector_graphics 1.1.11+1
    • flutter any
    • http ^1.0.0
    • vector_graphics_codec 1.1.11+1
  • vector_graphics_codec 1.1.11+1
  • vector_graphics_compiler 1.1.11+1
    • args ^2.3.0
    • meta ^1.7.0
    • path_parsing ^1.0.1
    • xml ^6.3.0
    • vector_graphics_codec 1.1.11+1
    • path ^1.8.0
  • vector_math 2.1.4
  • vm_service 13.0.0
  • watcher 1.1.0
    • async ^2.5.0
    • path ^1.8.0
  • web 0.5.1
  • web_socket_channel 2.4.4
    • async ^2.5.0
    • crypto ^3.0.0
    • stream_channel ^2.1.0
    • web ^0.5.0
  • xml 6.5.0
    • collection ^1.18.0
    • meta ^1.9.0
    • petitparser ^6.0.0
  • yaml 3.1.2
    • collection ^1.15.0
    • source_span ^1.8.0
    • string_scanner ^1.1.0

Steps to reproduce

  1. Login
  2. Logout from ProfileScreen (or delete account)

Expected Behavior

No error thrown.

Actual Behavior

Error thrown:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following TypeErrorImpl was thrown building Builder(dirty):
Unexpected null value.

The relevant error-causing widget was:
  ProfileScreen
  ProfileScreen:file:///Users/martin/dev/firebasetesting/chatapp/flutter/lib/pages/profile/profile_page.dart:14:12

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 297:3       throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 806:18  nullCheck
packages/firebase_ui_auth/src/screens/profile_screen.dart 809:34                  buildPage
packages/flutter/src/widgets/basic.dart 7698:48                                   build
packages/flutter/src/widgets/framework.dart 5550:22                               build
packages/flutter/src/widgets/framework.dart 5480:15                               performRebuild
packages/flutter/src/widgets/framework.dart 5196:7                                rebuild
packages/flutter/src/widgets/framework.dart 2904:18                               buildScope
packages/flutter/src/widgets/binding.dart 989:9                                   drawFrame
packages/flutter/src/rendering/binding.dart 448:5                                 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1386:7                                [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1311:9                                handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1169:5                                [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1346:5                                invoke
lib/_engine/engine/platform_dispatcher.dart 260:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 185:36                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 550:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 555:39  dcall

════════════════════════════════════════════════════════════════════════════════════════════════════

Additional Information

ProfileScreen created like this:

ProfileScreen(
      auth: firebaseAuth,
      providers: const [],
      appBar: AppBar(
        leading: BackButton(onPressed: () => context.router.pop()),
      ),
      showDeleteConfirmationDialog: true,
      actions: [
        SignedOutAction((context) => context.router.pop()),
        AccountDeletedAction((context, user) => context.router.pop()),
      ],
    )

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.1, on macOS 14.2.1 23C71 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.87.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

@martinsellergren martinsellergren changed the title 🐛 [firebase_ui_auth] Crash on sign out: Unexpected null value 🐛 [firebase_ui_auth] Crash on sign out in web: Unexpected null value Mar 14, 2024
@russellwheatley
Copy link
Member

I've just tested on the auth example app, I think there is a problem with your setup as I logged in/out without issue on web.

@russellwheatley russellwheatley added auth blocked: customer response Waiting for customer response, e.g. more information was requested. labels Mar 14, 2024
@Lejoni
Copy link

Lejoni commented May 25, 2024

I get the same error in my Android app using ProfileScreen.
For me the error is triggered when SignedOutAction has a callback function that tries to do anything else than just navigate to a new screen.

Example1 works fine, no error:

return ProfileScreen(
            providers: providers,
            actions: [
              SignedOutAction((context) {
                Navigator.pushReplacementNamed(context, '/');
              }),
            ],
          );

while Example2 throws the Unexpected null value. error:

return ProfileScreen(
            providers: providers,
            actions: [
              SignedOutAction((context) {
                handleUserSignedOut();
                Navigator.pushReplacementNamed(context, '/');
              }),
            ],
          );

I find this confusing as the following example with SignInScreen works just fine:

return SignInScreen(
            providers: providers,
            actions: [
              AuthStateChangeAction<SignedIn>((context, state) {
                handleUserSignedIn();
                Navigator.pushReplacementNamed(context, '/');
              }),
            ],
          );

Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Stale Issue with no recent activity label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth blocked: customer response Waiting for customer response, e.g. more information was requested. Stale Issue with no recent activity
Projects
None yet
Development

No branches or pull requests

3 participants