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

🐛 [cloud_firestore] runTransaction stopped working on web. #9195

Closed
bernaferrari opened this issue Jul 22, 2022 · 4 comments
Closed

🐛 [cloud_firestore] runTransaction stopped working on web. #9195

bernaferrari opened this issue Jul 22, 2022 · 4 comments
Labels
resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working

Comments

@bernaferrari
Copy link
Contributor

bernaferrari commented Jul 22, 2022

I just updated firebase to the last version and the following code is breaking on the web. On macOS it works fine.

This is the previous version I was using, which worked:

direct dependencies:                 
async                                 *2.8.2     *2.8.2      *2.8.2      2.9.0     
cloud_firestore                       *3.3.0     3.4.0       3.4.0       3.4.0     
cloud_functions                       *3.3.2     3.3.3       3.3.3       3.3.3     
firebase_auth                         *3.4.2     3.5.0       3.5.0       3.5.0     
firebase_core                         *1.19.2    1.20.0      1.20.0      1.20.0    
firebase_database                     *9.0.19    9.0.20      9.0.20      9.0.20    
firebase_storage                      *10.3.2    10.3.3      10.3.3      10.3.3    
flutter_multi_formatter               *2.5.7     2.5.8       2.5.8       2.5.8     

This is the code I'm running, there is nothing abnormal:

await FirebaseFirestore.instance.runTransaction((transaction) async {
          for (final data in data.websitesHistory) {
            transaction.set(documentReference, serverData.toJson());
          }
});

This is the error message (in console only, no message in IntelliJ):

Error: firebase_firestore.TransactionOptions is not a constructor
main.dart.js?v=2887564051:62600

TypeError: firebase_firestore.TransactionOptions is not a constructor

It is an horrible bug because a try/catch won't catch it. Might be coming from the platform.

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
➜ flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 11.4 20F71 darwin-x64, locale
    en-BR)
    • Flutter version 3.0.5 at /usr/local/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f1875d570e (9 days ago), 2022-07-13 11:24:16 -0700
    • Engine revision e85ea0e79c
    • Dart version 2.17.6
    • DevTools version 2.12.2

@bernaferrari bernaferrari added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jul 22, 2022
@kaumudpa
Copy link

Same problem here across projects.

@MrMagloire
Copy link

Same problem here across projects.

@darshankawar darshankawar added the triage Issue is currently being triaged. label Jul 25, 2022
@darshankawar
Copy link

The possible fix seems to have been merged #9188 and new version of the plugin (web) is also released: https://pub.dev/packages/cloud_firestore_web/changelog#281.
Please try using latest plugin version and see if it works.

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jul 25, 2022
@bernaferrari
Copy link
Contributor Author

On changelog it should be "fix runTransaction" because it is a lot more severe than it is written.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jul 25, 2022
@darshankawar darshankawar added resolution: fixed A fix has been merged or is pending merge from a PR. and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Jul 26, 2022
@firebase firebase locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: fixed A fix has been merged or is pending merge from a PR. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants