Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

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

Closed
mrmayurgithub opened this issue Jan 25, 2021 · 1 comment
Closed

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

mrmayurgithub opened this issue Jan 25, 2021 · 1 comment

Comments

@mrmayurgithub
Copy link

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 main__closure1.$call$body$main__closure (http://localhost:36109/dwds/src/injected/client.js:22088:16)
at main__closure1.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 _AsyncRun__initializeScheduleImmediate_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 -

<script src="/__/firebase/8.2.3/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/7.14.4/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/7.14.4/firebase-auth.js"></script>
@mrmayurgithub
Copy link
Author

I made some changes index.html -

<script src="https://www.gstatic.com/firebasejs/8.2.4/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/8.2.4/firebase-firestore.js"></script>

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant