When I try to run the flutter app with firebase then I got below exception in the console
Connecting to VM Service at ws://127.0.0.1:62079/C02ZiuJk_8g=/ws TypeError: Cannot read properties of undefined (reading 'app') at Object.app$ [as app] (http://localhost:53062/packages/firebase_core_web/src/interop/core.dart.lib.js:31:101) at new cloud_firestore_web.FirebaseFirestoreWeb.new (http://localhost:53062/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:833:64) at Function.registerWith (http://localhost:53062/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:745:73) at Object.registerPlugins (http://localhost:53062/packages/mekfox/generated_plugin_registrant.dart.lib.js:17:46) at main (http://localhost:53062/web_entrypoint.dart.lib.js:31:35) at main.next (<anonymous>) at runBody (http://localhost:53062/dart_sdk.js:38659:34) at Object._async [as async] (http://localhost:53062/dart_sdk.js:38690:7) at main$ (http://localhost:53062/web_entrypoint.dart.lib.js:30:18)
The fix for this is to add firebase javascript files to index.html under web folder
<body> <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js"></script> <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-storage.js"></script>