Latest flutterfire_ui could not build in web
When run flutter build web --release
cloud_firestore_web-2.6.10/lib/src/internals.dart:11:20:
Error: Method not found: 'guardWebExceptions'.
return internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
Error: Compilation failed.
This is because some firestore packages are updated within the package.
Similar Issue here: Target dart2js failed: Exception: ../../../flutter_windows_2.8.1-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage_web-3.2.10/lib/src/utils/errors.dart:20:20: Error: Method not found: 'guardWebExceptions'. return internals.guardWebExceptions( ^^^^^^^^^^^^^^^^^^ Error: Compilation failed.
@richard457 Try this: https://stackoverflow.com/questions/71261321/flutter-app-running-on-web-failing-with-error
You can try to add 6 dependencies, as mentioned in the answer. It should resolve the issue with guardWebException. It worked in my case.
@dreamsandcode You should also try adding these dependencies in pubspec.yaml
@richard457 Check this comment and upgrade as mentioned in it and see if it helps to resolve the issue.
Make sure to add:
dependencies:
firebase_core: ^1.13.1
Make sure to add:
dependencies: firebase_core: ^1.13.1
This was the solution for me. I previously had 1.12.0. Thank you @rrousselGit
firebase_core: ^1.12.0 -> firebase_core: ^1.13.1
cloud_firestore: ^3.1.8 -> cloud_firestore: ^3.1.10
firebase_analytics: ^9.1.0 -> firebase_analytics: ^9.1.2
Then do:
flutter clean
flutter run
This works for me, greetings!
Make sure to add:
dependencies: firebase_core: ^1.13.1
This helped me a lot, thanks