googlearchive / firebase-dart

Dart wrapper for Firebase
https://pub.dev/packages/firebase
404 stars 144 forks source link

TypeError: dart.global.firebase.firestore is not a function #383

Closed mrmayurgithub closed 3 years ago

mrmayurgithub commented 3 years ago

TypeError: dart.global.firebase.firestore is not a function at Object.getFirestoreInstance (http://localhost:36109/packages/cloud_firestore_web/src/interop/utils/utils.dart.lib.js:997:79) at new cloud_firestore_web.FirebaseFirestoreWeb.new (http://localhost:36109/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:863:37) at Function.registerWith (http://localhost:36109/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:745:73) at Object.registerPlugins (http://localhost:36109/packages/opinionx/generated_plugin_registrant.dart.lib.js:19:46) at main (http://localhost:36109/web_entrypoint.dart.lib.js:29:35) at main.next () at runBody (http://localhost:36109/dart_sdk.js:37976:34) at Object._async [as async] (http://localhost:36109/dart_sdk.js:38007:7) at main$ (http://localhost:36109/web_entrypoint.dart.lib.js:28:18) at http://localhost:36109/main_module.bootstrap.js:20:10 at Array.forEach () at window.$dartRunMain (http://localhost:36109/main_module.bootstrap.js:19:32) at :1:8 at Object.runMain (http://localhost:36109/dwds/src/injected/client.js:8685:21) at http://localhost:36109/dwds/src/injected/client.js:22076:19 at _wrapJsFunctionForAsync_closure.$protected (http://localhost:36109/dwds/src/injected/client.js:3826:15) at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:36109/dwds/src/injected/client.js:10919:12) at Object._asyncStartSync (http://localhost:36109/dwds/src/injected/client.js:3790:20) at mainclosure1.$call$body$mainclosure (http://localhost:36109/dwds/src/injected/client.js:22088:16) at mainclosure1.call$1 (http://localhost:36109/dwds/src/injected/client.js:22015:19) at StaticClosure._rootRunUnary [as call$2$5] (http://localhost:36109/dwds/src/injected/client.js:4150:16) at _CustomZone.runUnary$2$2 (http://localhost:36109/dwds/src/injected/client.js:12150:39) at _CustomZone.runUnaryGuarded$1$2 (http://localhost:36109/dwds/src/injected/client.js:12082:14) at _ControllerSubscription._sendData$1 (http://localhost:36109/dwds/src/injected/client.js:11711:19) at _DelayedData.perform$1 (http://localhost:36109/dwds/src/injected/client.js:11863:59) at _PendingEvents_schedule_closure.call$0 (http://localhost:36109/dwds/src/injected/client.js:11912:14) at Object._microtaskLoop (http://localhost:36109/dwds/src/injected/client.js:3986:24) at StaticClosure._startMicrotaskLoop (http://localhost:36109/dwds/src/injected/client.js:3992:11) at _AsyncRuninitializeScheduleImmediate_internalCallback.call$1 (http://localhost:36109/dwds/src/injected/client.js:10788:9) at invokeClosure (http://localhost:36109/dwds/src/injected/client.js:1238:26) at MutationObserver. (http://localhost:36109/dwds/src/injected/client.js:1257:18)

In pubspec.yaml, I have used - cloud_firestore: ^0.16.0 firebase_auth: ^0.20.0+1 firebase_core: ^0.7.0

In index.html -

mrmayurgithub commented 3 years ago

I made some changes index.html -

In pubspec.yaml, I have used - cloud_firestore: ^0.16.0 firebase_auth: ^0.20.0+1 firebase_core: ^0.7.0

Everything worked fine.