我的项目使用Firebase作为后端,这是配置文件:
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);
尝试使用as重命名函数:
import { getFirestore as getFirestoreFunction } from "firebase/firestore";
对于getFirestore起作用了
未捕获的语法错误:不明确的间接导出:initializeApp
尝试对initializeApp做同样的操作
import { initializeApp as initFirebaseApp } from "firebase/app";
未捕获的语法错误:不明确的间接导出:initializeApp
这里的版本是"firebase": "^8.6.8"
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号