2

i am new to flutter.when i run this code on flutter web this error occurs. .pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-1.0.7/lib/src/internals.dart:10:20:

some one help to get rid of the problem

4 Answers 4

1
cloud_firestore: ^3.1.13 
cloud_firestore_web: ^2.6.13

add the above the packages to your pubspec.yaml file

1

Either you can upgrade your all firebase packages to the available latest version (Mainly firebase_core to the latest version) or else you can modify the error which we get for internals like below:

Step-1: Open the internals.dart file of the firebase package which you face the error.

Step-2: Change function use from internals.guard() to internals.guardWebExceptions() like below:

From:

return internals.guard(
    cb,
    plugin: 'app-check',
    codeParser: (code) => code.replaceFirst('appCheck/', ''),
  );

To:

return internals.guardWebExceptions(
    cb,
    plugin: 'app-check',
    codeParser: (code) => code.replaceFirst('appCheck/', ''),
  );

Notes:

  • This modification will remain locally so remember to change every time if you do flutter clean or run the app in a different system.
  • Above example is for Firebase AppCheck. You can get the same error for another firebase service. So, modify only that internals from the specific firebase service error that you have faced.
1
  • "upgrade your all firebase packages to the available latest version" Worked for me! Thanks Commented May 26, 2022 at 20:56
0

Below thing worked for me :

I upgraded :

firebase_core: ^1.0.4 to firebase_core: ^1.13.1

cloud_firestore: ^1.0.6 to cloud_firestore: ^3.1.10

firebase_analytics: ^9.1.0 -> firebase_analytics: ^9.1.2

Then do:

flutter clean

flutter run

Refer : https://github.com/firebase/flutterfire/issues/8194 For more info

2
  • This i s my Answer, Remove the answer or else I'll raise flag Commented Apr 28, 2022 at 10:30
  • @AnandhKrishnan, NP i will remove it. But could you look at difference, In my case i also required to upgrade firebase core and firebase_analytics
    – Djai
    Commented Apr 28, 2022 at 11:54
-2

If you updated your flutter sdk to Beta channel, Downgrade your flutter sdk to Stable Channel. Current stable version is 2.10.3

Flutter downgrade command

flutter downgrade v2.10.3

and than

Downgrade flutter to version 2.10.3
? [y|n]:
Type y for Yes to confirm changes

If the above method does'nt work try this

cloud_firestore: ^3.1.13 
cloud_firestore_web: ^2.6.13 

add the above the packages to your pubspec.yaml file with updated version

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.