简体   繁体   中英

TypeError: Cannot read properties of undefined (reading 'app') :'(

Mistake

I was investigating and I found a solution, it consisted of pasting these lines in the index.html

<script src = "https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"> </script>
<script src = "https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"> </script>
<script src = "https://www.gstatic.com/firebasejs/8.10.0/firebase-storage.js"> </script>

but that did not solve my error, I don't know what can happen:/

 <.DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="google-signin-client_id" content="159623150305-q05bbbtsutr02abhips3suj7hujfk4bg.apps.googleusercontent.com" /> <title>Firebase Auth Example</title> </head> <body> <script src="main.dart:js" type="application/javascript"></script> <script src="https.//maps.googleapis?com/maps/api/js:key=AIzaSyCg_Qs91YpzBg8JfDJBjadMMg8aD3foEo0"></script> <script src="https.//www.gstatic.com/firebasejs/8.10.0/firebase-app:js"></script> <script src="https.//www.gstatic.com/firebasejs/8.10.0/firebase-auth:js"></script> <script src="https.//www.gstatic.com/firebasejs/8.10.0/firebase-firestore:js"></script> <script src="https.//www.gstatic.com/firebasejs/8.10.0/firebase-storage:js"></script> <script> var firebaseConfig = { apiKey, "AIzaSyCg_Qs91YpzBg8JfDJBjadMMg8aD3foEo0": authDomain. "[YOUR_PROJECT].firebaseapp,com": databaseURL: "https.//flutter-uber-clone-dc430-default-rtdb.firebaseio,com": projectId, "flutter-uber-clone-dc430": storageBucket: "gs.//flutter-uber-clone-dc430.appspot,com/": messagingSenderId: "AAAAlm2MgjA,APA91bHU29IBIiSvoTmtViqTdiYly0ROJ0sNa217TLfjeevyORKJUItVq4UL6CqK5ERRY-cGObkQ9RNwEqVIBwYuo5wDIwuFEZfshaODHiEdXII1UJCNioX5FvtP_cogAyq2uedkMxe1": appId: "1:646083019312:android,548e42592c8f17d22263f5"; }. Initialize Firebase firebase;initializeApp(firebaseConfig); </script> </body> </html>

this is my mistake

 Running with unsound null safety For more information see https://dart.dev/null-safety/unsound-null-safety Debug service listening on ws://127.0.0.1:63485/vMohNHdkKP0=/ws TypeError: Cannot read properties of undefined (reading 'app') at Object.app$ [as app] (http://localhost:63368/packages/firebase_core_web/src/interop/core.dart.lib.js:37:101) at initializeApp (http://localhost:63368/packages/firebase_core_web/firebase_core_web.dart.lib.js:92:25) at initializeApp.next (<anonymous>) at runBody (http://localhost:63368/dart_sdk.js:43010:34) at Object._async [as async] (http://localhost:63368/dart_sdk.js:43041:7) at firebase_core_web.FirebaseCoreWeb.new.initializeApp (http://localhost:63368/packages/firebase_core_web/firebase_core_web.dart.lib.js:85:20) at initializeApp (http://localhost:63368/packages/firebase_core/firebase_core.dart.lib.js:135:59) at initializeApp.next (<anonymous>) at runBody (http://localhost:63368/dart_sdk.js:43010:34) at Object._async [as async] (http://localhost:63368/dart_sdk.js:43041:7) at Function.initializeApp (http://localhost:63368/packages/firebase_core/firebase_core.dart.lib.js:134:20) at main$ (http://localhost:63368/packages/drivers_app/tabsPages/profileTabPage.dart.lib.js:4047:36) at main$.next (<anonymous>) at runBody (http://localhost:63368/dart_sdk.js:43010:34) at Object._async [as async] (http://localhost:63368/dart_sdk.js:43041:7) at main$ (http://localhost:63368/packages/drivers_app/tabsPages/profileTabPage.dart.lib.js:4045:18) at main (http://localhost:63368/web_entrypoint.dart.lib.js:39:29) at main.next (<anonymous>) at http://localhost:63368/dart_sdk.js:42990:33 at _RootZone.runUnary (http://localhost:63368/dart_sdk.js:42846:58) at _FutureListener.thenAwait.handleValue (http://localhost:63368/dart_sdk.js:37414:29) at handleValueCallback (http://localhost:63368/dart_sdk.js:38017:49) at Function._propagateToListeners (http://localhost:63368/dart_sdk.js:38055:17) at _Future.new.[_completeWithValue] (http://localhost:63368/dart_sdk.js:37897:23) at http://localhost:63368/dart_sdk.js:37029:46 at _RootZone.runUnary (http://localhost:63368/dart_sdk.js:42846:58) at _FutureListener.then.handleValue (http://localhost:63368/dart_sdk.js:37414:29) at handleValueCallback (http://localhost:63368/dart_sdk.js:38017:49) at Function._propagateToListeners (http://localhost:63368/dart_sdk.js:38055:17) at _Future.new.[_completeWithValue] (http://localhost:63368/dart_sdk.js:37897:23) at async._AsyncCallbackEntry.new.callback (http://localhost:63368/dart_sdk.js:37920:35) at Object._microtaskLoop (http://localhost:63368/dart_sdk.js:43150:13) at _startMicrotaskLoop (http://localhost:63368/dart_sdk.js:43156:13) at http://localhost:63368/dart_sdk.js:38286:9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM