-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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] Uncaught TypeError: Cannot read properties of undefined (reading 'apply') #9106
Comments
Thanks for the report @ViniciusSossela
Also, can you provide |
Hi @darshankawar thanks to reply. Just looked at my pub.lock:
So basically it was using the last firebase core version, but I also made test with the latest firebase versions and the same happens. Here are the
and here the main.dart firebase initializer:
|
Can you try adding below imports in
|
@darshankawar Just added as you suggested, but the same happens:
The errors that happens with the scripts on
|
It seems a problem with the Solved the issue by downgrading to the following package version:
|
Thanks for the update. Using below dependency plugin and trying to run plugin's example on web, I am getting another error which is pointing to
Labeling it based on the report. |
I have the same error: working fine in debug mode but error in deployment. |
I just tried batch on debug and release mode and works fine for both. |
@Lyokone I did get the bug on a simple get query in deployment only. Sample code below: Query query = postsRef.orderBy('created_time', descending: true); query = query.where('followers', arrayContains: _user!.uid); if (!isAdmin) { print('Constructed query $query'); QuerySnapshot querySnapshot = await query.get(); print('Query completed'); In debug mode, everything works fine. In deployment, the last print statement was never reached. It seems query.get() is where the bug is. I needed to downgrade all firestore packages: pub outdated output: Package Name Current Upgradable Resolvable Latest direct dependencies: flutter doctor -v [✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] VS Code (version 1.69.1) [✓] Connected device (3 available) [✓] HTTP Host Availability |
I'm in dependency hell trying to get around this issue. If I try to downgrade firebase_auth to 3.4.1 I get: ../flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.4.1/lib/src/recaptcha_verifier.dart:57:27: Error: Required named parameter 'auth' must be provided. If I upgrade firebase_auth to 3.4.2 or higher than it requires firebase_core_web: 1.7 . If I upgrade firebase_core_web 1.7 then I inherit the issues listed here. What is the fix? |
I fixed one 3.4.1 auth issue with #9216, but now I just have more issues: Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead. This just seems like a bottomless pit of issues trying to downgrade various things. I really can't figure out the right combinations. The one listed above causes errors. I'm in a bind because we just released our new mobile version last night, and I had to put the web update or else the two wouldn't play well together. However, as mentioned here, I have functionality that works in debug, but breaks on release build, and so I have full features that just don't load. This issue has been open for 11 days which leads me to believe that this isn't urgent. I just am at a loss here, I have been working on this all day and only running into more and more issues as I try to fix this original issue. This is supposed to be the stable branch! |
You might want to run |
Yeah, I'm on my 100th flutter clean today. And yes, I wish the latest versions didn't have these issues so that we could use them. |
I've tried all the combinations that you provided @binlebin and they all work in debug and release on the Example app of FlutterFire. |
Which |
For what it's worth. I get this error when I use the Query option "startAfterDocument()" in my query. Like everyone else says, this works find in debug builds, but gives the mentioned error message in release builds. |
@m-j-g did you tried |
I also notice the error might be because of "startAfterDocument()" as my first page loads fine. @m-j-g You might want to reuse old pubspec.lock of a version that was working fine. |
I've been trying so hard to use it. haha. But it requires me to downgrade the auth library, and then it starts a bunch of other dependency / outdated issues.
That's a good point. I have the same experience, initial list data loads fine, but when I query for more using startAfterDocument() the error happens. (only on web release, once again works fine on web debug and on iOS/android) |
@m-j-g Yeah, I got the same. This bug got me crazy man.... Did you also tried the new version |
Yeah, still has the issue. |
@m-j-g try all these firebase dependencies..
To me it worked. |
It works! Thanks man, I really appreciate that. |
Hey, I can finally reproduce the error, thanks @binlebin, I'll check what can cause the compilation in JS not to work properly |
We have raised the issue internally with Google to see what happens with dart2js. We'll keep you posted here. |
It was fixed with 3.6.1 |
Tested the new version and it worked fine :) Thanks! |
3.6.1 fixed the auth persistence bug. I am still experiencing the |
+1. production build still breaks due to this |
@hugopretorius914 @shadowboxingskills have you tried with these versions ?
The fix seems to be in the cloud_firestore @Lyokone Have this PR also fixed the problem with
|
Yes, upgraded to these latest versions above but crash still occurs in production (not in debug) |
Yes, I get the same as @shadowboxingskills the crash still happens in production with all those version but works fine in debug |
It has been fixed in the latest release earlier today. |
Bug report
Some firestore method/execution on web are trowing the following error:
This only happens after deploying on web, in debug everything is fine;
Steps to reproduce
Additional context
Already have notice that this error happens when using firestore batch.
Example:
Flutter doctor
Run
flutter doctor
and paste the output below:Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 3.0.5, on macOS 12.1 21C52 darwin-x64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.69.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!
The text was updated successfully, but these errors were encountered: