I have using firebase for project flutter of me. but when I want build web not work
step1: I run
flutter config --enable-web
step2: I run
flutter run -d chrome
and after appear error bellow
TypeError: Cannot read property 'app' of undefined
at Object.app$ [as app] (http://localhost:63143/packages/firebase_core_web/src/interop/core.dart.lib.js:48:101)
at new cloud_firestore_web.FirebaseFirestoreWeb.new
(http://localhost:63143/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:873:64)
at Function.registerWith (http://localhost:63143/packages/cloud_firestore_web/src/write_batch_web.dart.lib.js:755:73)
at Object.registerPlugins (http://localhost:63143/packages/doxaspc/generated_plugin_registrant.dart.lib.js:34:46)
at main (http://localhost:63143/web_entrypoint.dart.lib.js:44:35)
at main.next (<anonymous>)
at runBody (http://localhost:63143/dart_sdk.js:39052:34)
at Object._async [as async] (http://localhost:63143/dart_sdk.js:39083:7)
at main$ (http://localhost:63143/web_entrypoint.dart.lib.js:43:18)
at http://localhost:63143/main_module.bootstrap.js:19:10
at Array.forEach (<anonymous>)
at window.$dartRunMain (http://localhost:63143/main_module.bootstrap.js:18:32)
at <anonymous>:1:8
at Object.runMain (http://localhost:63143/dwds/src/injected/client.js:8656:21)
at http://localhost:63143/dwds/src/injected/client.js:22068:19
at _wrapJsFunctionForAsync_closure.$protected (http://localhost:63143/dwds/src/injected/client.js:3830:15)
at _wrapJsFunctionForAsync_closure.call$2 (http://localhost:63143/dwds/src/injected/client.js:10905:12)
at Object._asyncStartSync (http://localhost:63143/dwds/src/injected/client.js:3794:20)
...
file index.html of me
<!DOCTYPE html>
<html>
<head>
<base href="/">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="doxaspc">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- Firebase Setup -->
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.8.0/firebase-firestore.js"></script>
<script>
var firebaseConfig = {
apiKey: "AIzaSyD3kioPzFSkD6xXndI9fkguKhj0Qadb304",
authDomain: "fir-d71eb.firebaseapp.com",
projectId: "fir-d71eb",
storageBucket: "fir-d71eb.appspot.com",
messagingSenderId: "983518157786",
appId: "1:983518157786:web:b8db1e8f8806292de97ee3",
measurementId: "G-Z2Q69GT9WB"
};
firebase.initializeApp(firebaseConfig);
</script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('flutter-first-frame', function () {
navigator.serviceWorker.register('flutter_service_worker.js');
});
}
</script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>
I want enable web from project app flutter of me but I dont know I miss step? please show me how ? please help me