Home  >  Q&A  >  body text

The project has been running well, but suddenly this error appeared, Uncaught SyntaxError: ambiguous indirect export: getFirestore, for unknown reasons

<p>My project uses Firebase as the backend, this is the configuration file: </p> <pre class="brush:php;toolbar:false;">import { initializeApp } from "firebase/app"; import { getAuth } from "firebase/auth"; import { getFirestore } from "firebase/firestore"; import { getStorage } from "firebase/storage"; const firebaseConfig = { stuff... }; const app = initializeApp(firebaseConfig); export const auth = getAuth(app); export const db = getFirestore(app); export const storage = getStorage(app);</pre> <p>Try using as to rename the function: </p> <pre class="brush:php;toolbar:false;">import { getFirestore as getFirestoreFunction } from "firebase/firestore";</pre> <blockquote> <p>It works for getFirestore</p> </blockquote> <blockquote> <p>Uncaught syntax error: ambiguous indirect export: initializeApp</p> </blockquote> <blockquote> <p>Try the same thing with initializeApp</p> </blockquote> <pre class="brush:php;toolbar:false;">import { initializeApp as initFirebaseApp } from "firebase/app";</pre> <blockquote> <p>Uncaught syntax error: ambiguous indirect export: initializeApp</p> </blockquote> <p>The version here is "firebase": "^8.6.8"</p>
P粉790819727P粉790819727385 days ago513

reply all(1)I'll reply

  • P粉277824378

    P粉2778243782023-09-05 15:55:04

    Looks like you are running an outdated version of firebase. Installing the latest version should theoretically solve the problem you are facing. You can refer to the comments on this link: https://stackoverflow.com/a/70164464/19119712

    If you make a change, please let me know if it works. Good luck!

    reply
    0
  • Cancelreply