firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.69k stars 3.97k forks source link

πŸ› [cloud_firestore] / [cloud_firestore_web] Error on update with FieldValue.arrayUnion() #10475

Closed bgetsug closed 1 year ago

bgetsug commented 1 year ago

Bug report

I was suffering from issue #10451, so I updated to cloud_firestore 4.4.1, and now I'm getting the following error when attempting a document update with a FieldValue.arrayUnion(...):

Error: [cloud_firestore/invalid-argument] Function updateDoc() called with invalid data. Unsupported field value: a custom _FieldValueArrayUnion object (found in field comments in document...

Steps to reproduce / sample code

/// Example class that holds comments
class Thing {
    String id;
    List<Comment> comments;
    //...
}

/// Example class for comment objects
class Comment {
  final String id;
  final String userId;
  final DateTime date;
  final String text;

  Comment({
    required String id,
    required this.userId,
    DateTime? date,
    required this.text,
  })  : date = date ?? DateTime.now();

  Map<String, dynamic> toFirestore() => <String, dynamic>{
      'id': instance.id,
      'profileId': instance.profileId,
      'date': instance.date.toIso8601String(),
      'text': instance.text,
    };
}

FirebaseFirestore.instance
          .collection("things")
          .doc("thing-id")
          .update(<Object, Object?>{
        "comments": FieldValue.arrayUnion(comment.toFirestore()]),
      })

Expected behavior

The update completes without error.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [βœ“] Flutter (Channel stable, 3.7.3, on macOS 13.2.1 22D68 darwin-arm64, locale en-US) [βœ“] Xcode - develop for iOS and macOS (Xcode 14.2) [βœ“] Chrome - develop for the web [βœ“] IntelliJ IDEA Ultimate Edition (version 2022.3.2) [βœ“] IntelliJ IDEA Ultimate Edition (version 2022.3.2) [βœ“] IntelliJ IDEA Ultimate Edition (version 2022.3.1) [βœ“] Connected device (2 available) [βœ“] HTTP Host Availability ```

Flutter dependencies

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

Click To Expand ``` Dart SDK 2.19.2 Flutter SDK 3.7.3 emce_mobile 3.0.14+2 dependencies: - add_2_calendar 2.2.3 [flutter] - animate_do 3.0.2 [flutter] - animations 2.0.7 [flutter] - ansicolor 2.0.1 - avatar_glow 2.0.2 [flutter] - barcode_scan2 4.2.3 [flutter protobuf] - bubble 1.2.1 [flutter] - built_collection 5.1.1 - camera 0.10.3 [camera_android camera_avfoundation camera_platform_interface camera_web flutter flutter_plugin_android_lifecycle quiver] - cloud_firestore 4.4.1 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 4.0.9 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - collection 1.17.0 - connectivity_plus 3.0.3 [flutter flutter_web_plugins connectivity_plus_platform_interface js meta nm] - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - crypto 3.0.2 [typed_data] - cupertino_icons 1.0.5 - desktop_webview_auth 0.0.11 [crypto flutter http flutter_web_plugins plugin_platform_interface] - device_info_plus 8.1.0 [device_info_plus_platform_interface ffi file flutter flutter_web_plugins meta win32] - dio 4.0.6 [http_parser path] - dotted_border 2.0.0+3 [flutter path_drawing] - dotted_line 3.1.0 [flutter] - duration 3.0.12 - emce_data 3.0.14+4 [built_collection collection core emce_domain equatable json_annotation logging meta mockito protobuf quiver] - emce_domain 3.0.14+4 [ansicolor built_collection collection core equatable faker freezed_annotation humanizer intl jiffy json_annotation nanoid logging meta oxidized pdf protobuf quiver rrule squadron textwrap timeago timezone] - equatable 2.0.5 [collection meta] - event_bus 2.0.0 - excel 2.0.1 [archive xml equatable] - expandable 5.0.1 [flutter] - extended_masked_text 2.3.1 [flutter] - faker 2.1.0 [crypto] - feedback 2.4.1 [flutter flutter_localizations] - file_picker 5.2.5 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface ffi path win32] - filesize 2.0.1 - firebase_analytics 10.1.2 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_auth 4.2.7 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 2.6.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_dynamic_links 5.0.13 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_messaging 14.2.3 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.9.0+12 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_remote_config 3.0.11 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter] - firebase_storage 11.0.12 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - flex_color_picker 3.1.0 [flex_seed_scheme flutter] - flutter 0.0.0 [characters collection js material_color_utilities meta vector_math sky_engine] - flutter_bloc 8.1.2 [flutter bloc provider] - flutter_circular_chart 0.1.0 [flutter] - flutter_layout_grid 2.0.1 [flutter collection meta quiver] - flutter_localizations 0.0.0 [flutter intl characters clock collection js material_color_utilities meta path vector_math] - flutter_markdown 0.6.14 [flutter markdown meta path] - flutter_native_timezone 2.0.0 [flutter_web_plugins flutter js] - flutter_portal 1.1.3 [collection flutter vector_math] - flutter_redux 0.10.0 [redux flutter] - flutter_secure_storage 8.0.0 [flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows meta] - flutter_slidable 2.0.0 [flutter] - flutter_speed_dial 6.2.0 [flutter] - flutter_spinkit 5.1.0 [flutter] - flutter_staggered_grid_view 0.6.2 [flutter] - flutter_state_notifier 0.7.1 [flutter meta provider state_notifier] - flutter_sticky_header 0.6.5 [flutter value_layout_builder] - flutter_svg 2.0.1 [flutter vector_graphics vector_graphics_codec vector_graphics_compiler] - font_awesome_flutter 10.4.0 [flutter] - freezed_annotation 2.2.0 [collection json_annotation meta] - geocoding 2.0.5 [flutter geocoding_platform_interface] - geolocator 9.0.2 [flutter geolocator_platform_interface geolocator_android geolocator_apple geolocator_web geolocator_windows] - go_router 6.0.7 [collection flutter flutter_web_plugins logging meta] - google_place 0.4.7 [http] - google_sign_in 5.4.4 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - googleapis 10.1.0 [_discoveryapis_commons http] - googleapis_auth 1.3.1 [crypto http http_parser] - html 0.15.1 [csslib source_span] - humanizer 2.0.0 [decimal intl meta rational] - im_stepper 0.1.3 [flutter] - image 3.3.0 [archive meta xml] - image_cropper 3.0.1 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 0.8.6+1 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - intl 0.17.0 [clock path] - jiffy 5.0.0 [intl] - js 0.6.5 [meta] - json_annotation 4.8.0 [meta] - just_audio 0.9.31 [just_audio_platform_interface just_audio_web audio_session rxdart path path_provider async uuid crypto meta flutter] - keyboard_actions 4.1.0 [flutter] - logging 1.1.1 - map_launcher 2.5.0+1 [flutter] - maps_launcher 2.2.0 [flutter flutter_web_plugins url_launcher] - markdown_editable_textinput 2.0.2 [flutter effective_dart expandable] - mime 1.0.4 - modal_bottom_sheet 2.1.2 [flutter] - money2 3.3.0 [decimal fixed intl meta] - nanoid 1.0.0 - open_filex 4.3.2 [flutter ffi] - package_info_plus 3.0.3 [ffi flutter flutter_web_plugins http meta path package_info_plus_platform_interface win32] - pdf 3.8.4 [archive barcode crypto image meta path_parsing vector_math xml] - phone_number 1.0.0 [flutter meta] - photo_view 0.14.0 [flutter] - printing 5.9.3 [ffi flutter flutter_web_plugins http image js meta pdf plugin_platform_interface] - provider 6.0.5 [collection flutter nested] - quick_actions 1.0.1 [flutter quick_actions_android quick_actions_ios quick_actions_platform_interface] - quiver 3.2.1 [matcher] - recase 4.1.0 - redux 5.0.0 - redux_persist_flutter 0.9.0 [flutter path_provider shared_preferences redux_persist] - replay_bloc 0.2.3 [bloc] - responsive_builder 0.6.0 [flutter provider] - rrule 0.2.10 [collection intl meta time] - rxdart 0.27.7 - sentry_flutter 6.20.1 [flutter flutter_web_plugins sentry package_info_plus meta] - share_plus 6.3.1 [cross_file meta mime flutter flutter_web_plugins share_plus_platform_interface file url_launcher_web url_launcher_windows url_launcher_linux url_launcher_platform_interface ffi win32] - shimmer 2.0.0 [flutter] - sign_in_with_apple 4.3.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - sliver_tools 0.2.9 [flutter] - speech_to_text 6.1.1 [flutter speech_to_text_platform_interface speech_to_text_macos json_annotation clock pedantic flutter_web_plugins meta js] - squadron 4.3.3 - stack_trace 1.11.0 [path] - stripe_sdk 5.0.0-nullsafety.2 [flutter http url_launcher mask_text_input_formatter simple_animations awesome_card credit_card_validator collection webview_flutter universal_html] - syncfusion_flutter_calendar 20.4.50 [flutter timezone syncfusion_flutter_core syncfusion_flutter_datepicker intl] - syncfusion_flutter_charts 20.4.50 [flutter intl vector_math syncfusion_flutter_core] - syncfusion_flutter_datagrid 20.4.50 [flutter syncfusion_flutter_core collection] - syncfusion_flutter_datagrid_export 20.4.50-beta [flutter syncfusion_flutter_datagrid syncfusion_flutter_xlsio syncfusion_flutter_pdf collection] - syncfusion_flutter_datepicker 20.4.50 [flutter intl syncfusion_flutter_core] - syncfusion_flutter_gauges 20.4.50 [flutter syncfusion_flutter_core intl] - syncfusion_flutter_signaturepad 20.4.50 [flutter syncfusion_flutter_core] - synchronized 3.0.1 - table_calendar 3.0.8 [flutter intl simple_gesture_detector] - textfield_tags 1.4.3 [flutter] - time_overlapping 0.0.5 [equatable flutter] - timeago 3.3.0 [intl] - timeline_tile 2.0.0 [flutter] - timezone 0.9.1 [path] - tuple 2.0.1 - tutorial_coach_mark 1.2.5 [flutter flutter_lints] - units_converter 2.1.0 - universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io] - url_launcher 6.1.9 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - version 3.0.2 - wakelock 0.6.2 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web wakelock_windows] - webview_flutter 3.0.4 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] - window_size 0.1.0 [flutter] - yaml 3.1.1 [collection source_span string_scanner] dev dependencies: - bloc_test 9.1.1 [bloc diff_match_patch meta mocktail test] - build_runner 2.3.3 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - dart_code_metrics 5.6.0 [analyzer analyzer_plugin ansicolor args collection crypto dart_code_metrics_presets file glob html meta path platform pub_updater source_span xml yaml] - flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver archive async boolean_selector characters clock collection crypto js matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math] - flutter_launcher_icons 0.11.0 [args checked_yaml cli_util image json_annotation path yaml] - flutter_lints 2.0.1 [lints] - flutter_native_splash 2.2.16 [args flutter flutter_web_plugins js html image meta path universal_io xml yaml] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection js matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - freezed 2.3.2 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation] - integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service archive async boolean_selector characters clock collection crypto fake_async file js matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api typed_data vector_math webdriver] - json_serializable 6.6.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] - mockito 5.3.2 [analyzer build code_builder collection dart_style matcher meta path source_gen test_api] - test 1.22.0 [analyzer async boolean_selector collection coverage http_multi_server io js node_preamble package_config path pool shelf shelf_packages_handler shelf_static shelf_web_socket source_span stack_trace stream_channel typed_data web_socket_channel webkit_inspection_protocol yaml test_api test_core] - test_process 2.0.3 [async meta path test] dependency overrides: - core 1.36.0 [protobuf grpc fixnum] - emce_data 3.0.14+4 [built_collection collection core emce_domain equatable json_annotation logging meta mockito protobuf quiver] - emce_domain 3.0.14+4 [ansicolor built_collection collection core equatable faker freezed_annotation humanizer intl jiffy json_annotation nanoid logging meta oxidized pdf protobuf quiver rrule squadron textwrap timeago timezone] - font_awesome_flutter 10.4.0 [flutter] - modal_bottom_sheet 2.1.2 [flutter] transitive dependencies: - _discoveryapis_commons 1.0.5 [http http_parser meta] - _fe_analyzer_shared 52.0.0 [meta] - _flutterfire_internals 1.0.14 [collection firebase_core firebase_core_platform_interface flutter meta] - analyzer 5.4.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - analyzer_plugin 0.11.2 [analyzer collection dart_style pub_semver yaml] - archive 3.3.2 [crypto path] - args 2.4.0 - async 2.10.0 [collection meta] - audio_session 0.1.13 [flutter flutter_web_plugins rxdart meta] - awesome_card 1.1.7 [flutter] - barcode 2.2.3 [meta qr] - bloc 8.1.1 [meta] - boolean_selector 2.1.1 [source_span string_scanner] - build 2.3.1 [analyzer async convert crypto glob logging meta path] - build_config 1.1.1 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.1.0 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.7 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_value 8.4.3 [built_collection collection fixnum meta] - camera_android 0.10.4 [camera_platform_interface flutter flutter_plugin_android_lifecycle stream_transform] - camera_avfoundation 0.9.11 [camera_platform_interface flutter stream_transform] - camera_platform_interface 2.4.0 [cross_file flutter plugin_platform_interface stream_transform] - camera_web 0.3.1+1 [camera_platform_interface flutter flutter_web_plugins stream_transform] - characters 1.2.1 - charcode 1.3.1 - checked_yaml 2.0.2 [json_annotation source_span yaml] - cli_util 0.3.5 [meta path] - clock 1.1.1 - cloud_firestore_platform_interface 5.11.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 3.3.1 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.1.28 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.3.17 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - code_builder 4.4.0 [built_collection built_value collection matcher meta] - connectivity_plus_platform_interface 1.2.4 [flutter meta plugin_platform_interface] - convert 3.1.1 [typed_data] - coverage 1.6.3 [args logging package_config path source_maps stack_trace vm_service] - credit_card_type_detector 2.0.0 - credit_card_validator 2.0.1 [credit_card_type_detector] - cross_file 0.3.3+4 [js meta] - csslib 0.17.2 [source_span] - dart_code_metrics_presets 1.2.0 - dart_style 2.2.4 [analyzer args path pub_semver source_span] - dbus 0.7.8 [args ffi meta xml] - decimal 2.3.2 [rational] - device_info_plus_platform_interface 7.0.0 [flutter meta plugin_platform_interface] - diff_match_patch 0.4.1 - effective_dart 1.3.2 - fake_async 1.3.1 [clock collection] - ffi 2.0.1 - file 6.1.4 [meta path] - firebase_analytics_platform_interface 3.3.19 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.5.1+10 [_flutterfire_internals firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth_platform_interface 6.11.9 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 5.2.6 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.5.3 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 2.2.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_dynamic_links_platform_interface 0.2.3+28 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.2.12 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.2.13 [_flutterfire_internals firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance_platform_interface 0.1.1+31 [_flutterfire_internals firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.1+20 [_flutterfire_internals firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_remote_config_platform_interface 1.1.31 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface] - firebase_remote_config_web 1.1.20 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js] - firebase_storage_platform_interface 4.1.28 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.3.21 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - fixed 2.3.3 [decimal intl meta] - fixnum 1.1.0 - flex_seed_scheme 1.2.2 [flutter material_color_utilities meta] - flutter_plugin_android_lifecycle 2.0.7 [flutter] - flutter_secure_storage_linux 1.1.3 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 3.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.0.1 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.1.1 [flutter flutter_secure_storage_platform_interface flutter_web_plugins js] - flutter_secure_storage_windows 2.0.0 [flutter flutter_secure_storage_platform_interface] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 3.2.0 [async path] - fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform] - geocoding_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - geolocator_android 4.1.7 [flutter geolocator_platform_interface] - geolocator_apple 2.2.5 [flutter geolocator_platform_interface] - geolocator_platform_interface 4.0.7 [flutter plugin_platform_interface vector_math meta] - geolocator_web 2.1.6 [flutter flutter_web_plugins geolocator_platform_interface] - geolocator_windows 0.1.1 [flutter geolocator_platform_interface] - glob 2.1.1 [async collection file path string_scanner] - google_sign_in_android 6.1.6 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.5.1 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.3.0 [flutter plugin_platform_interface quiver] - google_sign_in_web 0.10.2+1 [flutter flutter_web_plugins google_sign_in_platform_interface js] - graphs 2.2.0 [collection] - grpc 3.1.0 [archive async crypto fixnum googleapis_auth meta http http2 protobuf] - http 0.13.5 [async http_parser meta path] - http2 2.0.1 - http_multi_server 3.2.1 [async] - http_parser 4.0.2 [collection source_span string_scanner typed_data] - image_cropper_for_web 1.0.3 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 3.0.3 [flutter plugin_platform_interface http] - image_picker_android 0.8.5+6 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.10 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.6+7 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.6.2 [cross_file flutter http plugin_platform_interface] - io 1.0.4 [meta path string_scanner] - just_audio_platform_interface 4.2.0 [flutter plugin_platform_interface] - just_audio_web 0.4.7 [just_audio_platform_interface flutter flutter_web_plugins] - lints 2.0.1 - markdown 7.0.1 [args meta] - mask_text_input_formatter 2.4.0 [flutter] - matcher 0.12.13 [meta stack_trace] - material_color_utilities 0.2.0 - meta 1.8.0 - mocktail 0.3.0 [collection matcher test] - nested 1.0.0 [flutter] - nm 0.5.0 [dbus] - node_preamble 2.0.1 - oxidized 5.3.0 [equatable] - package_config 2.1.0 [path] - package_info_plus_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - path 1.8.2 - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider 2.0.12 [flutter path_provider_android path_provider_foundation path_provider_linux path_provider_platform_interface path_provider_windows] - path_provider_android 2.0.22 [flutter path_provider_platform_interface] - path_provider_foundation 2.1.1 [flutter path_provider_platform_interface] - path_provider_linux 2.1.8 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.0.5 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.3 [ffi flutter path path_provider_platform_interface win32] - pedantic 1.11.1 - petitparser 5.1.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.3 [meta] - pool 1.5.1 [async stack_trace] - process 4.2.4 [file path platform] - protobuf 2.1.0 [fixnum collection meta] - pub_semver 2.1.3 [collection meta] - pub_updater 0.2.4 [http json_annotation process] - pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml] - qr 3.0.1 [meta] - quick_actions_android 1.0.0 [flutter quick_actions_platform_interface] - quick_actions_ios 1.0.2 [flutter quick_actions_platform_interface] - quick_actions_platform_interface 1.0.3 [flutter plugin_platform_interface] - rational 2.2.2 - redux_persist 0.9.0 [redux synchronized meta] - sentry 6.20.1 [http meta stack_trace uuid intl] - share_plus_platform_interface 3.2.0 [cross_file flutter meta mime plugin_platform_interface path_provider uuid] - shared_preferences 2.0.17 [flutter shared_preferences_android shared_preferences_foundation shared_preferences_linux shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - shared_preferences_android 2.0.15 [flutter shared_preferences_platform_interface] - shared_preferences_foundation 2.1.3 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.3 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface] - shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.3 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.4.0 [async collection http_parser path stack_trace stream_channel] - shelf_packages_handler 3.0.1 [path shelf shelf_static] - shelf_static 1.1.1 [convert http_parser mime path shelf] - shelf_web_socket 1.0.3 [shelf stream_channel web_socket_channel] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - simple_animations 4.2.0 [flutter collection] - simple_gesture_detector 0.2.0 [flutter] - sky_engine 0.0.99 - source_gen 1.2.7 [analyzer async build dart_style glob path source_span yaml] - source_helper 1.3.3 [analyzer collection source_gen] - source_map_stack_trace 2.1.1 [path source_maps stack_trace] - source_maps 0.10.11 [source_span] - source_span 1.9.1 [collection path term_glyph] - speech_to_text_macos 1.0.2 [flutter plugin_platform_interface speech_to_text_platform_interface] - speech_to_text_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - state_notifier 0.7.2+1 [meta] - stream_channel 2.1.1 [async] - stream_transform 2.1.0 - string_scanner 1.2.0 [source_span] - sync_http 0.3.1 - syncfusion_flutter_core 20.4.50 [vector_math flutter] - syncfusion_flutter_pdf 20.4.50 [flutter intl xml syncfusion_flutter_core crypto convert] - syncfusion_flutter_xlsio 20.4.50-beta [flutter xml archive image intl crypto jiffy syncfusion_officecore] - syncfusion_officecore 20.4.50-beta [flutter syncfusion_flutter_core] - term_glyph 1.2.1 - test_api 0.4.16 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - test_core 0.4.20 [analyzer async args boolean_selector collection coverage frontend_server_client glob io meta package_config path pool source_map_stack_trace source_maps source_span stack_trace stream_channel vm_service yaml matcher test_api] - textwrap 1.2.0 [meta] - time 2.1.3 [clock] - timing 1.0.1 [json_annotation] - typed_data 1.3.1 [collection] - universal_io 2.1.0 [collection crypto meta typed_data] - universal_platform 1.0.0+1 - url_launcher_android 6.0.23 [flutter url_launcher_platform_interface] - url_launcher_ios 6.1.0 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.2 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.2 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.1 [flutter plugin_platform_interface] - url_launcher_web 2.0.14 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.3 [flutter url_launcher_platform_interface] - uuid 3.0.7 [crypto] - value_layout_builder 0.3.1 [flutter] - vector_graphics 1.0.1 [flutter vector_graphics_codec] - vector_graphics_codec 1.0.1 - vector_graphics_compiler 1.0.1 [args meta path_parsing xml vector_graphics_codec] - vector_math 2.1.4 - vm_service 9.4.0 - wakelock_macos 0.4.0 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.3.0 [flutter meta] - wakelock_web 0.4.0 [flutter flutter_web_plugins js wakelock_platform_interface] - wakelock_windows 0.2.1 [flutter wakelock_platform_interface win32] - watcher 1.0.2 [async path] - web_socket_channel 2.3.0 [async crypto stream_channel] - webdriver 3.0.1 [archive matcher path stack_trace sync_http] - webkit_inspection_protocol 1.2.0 [logging] - webview_flutter_android 2.10.4 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 1.9.5 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 2.9.5 [flutter path webview_flutter_platform_interface] - win32 3.1.3 [ffi] - xdg_directories 1.0.0 [meta path process] - xml 6.2.2 [collection meta petitparser] ```
bgetsug commented 1 year ago

I'm rolling back to cloud_firestore 4.3.2 until this is resolved:

  cloud_firestore: 4.3.2
  cloud_firestore_platform_interface: 5.10.2
  cloud_firestore_web: 3.2.2
onayem commented 1 year ago

I can verify the issue. It occurs on other FieldValue methods, too. FieldValue.delete() did not work for me either.

Here is the function:

... .collection.doc("myDoc").update({'myField.myNestedField': FieldValue.delete()});

Here is the error:


Function updateDoc() called with invalid data. Unsupported field value: a custom _FieldValueDelete object 
(found in field 'myField.myNestedField' in document myDoc)```
edimarvirtual commented 1 year ago

I'm rolling back to cloud_firestore 4.3.2 until this is resolved:

  cloud_firestore: 4.3.2
  cloud_firestore_platform_interface: 5.10.2
  cloud_firestore_web: 3.2.2

Thanks for the tip, I'm using the same versions here until the problem is solved

DamienMrtl commented 1 year ago

I'm having the same error also using FieldValue.arrayUnion() in Flutter web

Lyokone commented 1 year ago

Thanks for the report. Will be fixed with #10481

Sorry for the issues with the update. It seems that Flutter 3.7 "broke" the CI, and tests appear to be passing on CI but only failing locally. We are investigating this.

Lyokone commented 1 year ago

It was released with cloud_firestore 4.4.2

bgetsug commented 1 year ago

Please reopen.

Things seem fine in debug, but in profile or release mode, I'm getting the following JavaScript errors:

Profile mode

js_helper.dart:1128 Uncaught TypeError: Cannot read properties of undefined (reading 'apply')
    at Object.callMethod (js_util_patch.dart:81:3)
    at DocumentReference0.update$1 (utils.dart:103:10)
    at DocumentReferenceWeb_update_closure.call$0 (document_reference_web.dart:43:15)
    at Object.guardWebExceptions (_flutterfire_internals.dart:112:19)
    at Object.convertWebExceptions1 (internals.dart:12:3)
    at DocumentReferenceWeb.update$1 (document_reference_web.dart:42:12)
    at document_reference.dart:176:12
    at _wrapJsFunctionForAsync_closure.$protected (async_patch.dart:317:19)
    at _wrapJsFunctionForAsync_closure.call$2 (async_patch.dart:342:23)
    at Object._asyncStartSync (async_patch.dart:247:3)

Release Mode

js_helper.dart:1128 Uncaught TypeError: Cannot read properties of undefined (reading 'apply')
    at Object.cP (js_util_patch.dart:81:3)
    at OU.dH (utils.dart:103:10)
    at cgI.$0 (document_reference_web.dart:43:15)
    at Object.eWp (_flutterfire_internals.dart:112:19)
    at Object.U_ (internals.dart:12:3)
    at b7l.dH (document_reference_web.dart:42:12)
    at document_reference.dart:176:12
    at eTt.a (async_patch.dart:317:19)
    at eTt.$2 (async_patch.dart:342:23)
    at Object.p (async_patch.dart:247:3)

I have verified that my pubspec.lock shows cloud_firestore_web 3.3.2.

ahmednfwela commented 1 year ago

@Lyokone I can verify this issue still occurs on cloud_firestore_web: 3.3.3, please reopen