项目一直运行良好,但突然出现了这个错误Uncaught SyntaxError: ambiguous indirect export: getFirestore,原因不明
<p>我的项目使用Firebase作为后端,这是配置文件:</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>尝试使用as重命名函数:</p>
<pre class="brush:php;toolbar:false;">import { getFirestore as getFirestoreFunction } from "firebase/firestore";</pre>
<blockquote>
<p>对于getFirestore起作用了</p>
</blockquote>
<blockquote>
<p>未捕获的语法错误:不明确的间接导出:initializeApp</p>
</blockquote>
<blockquote>
<p>尝试对initializeApp做同样的操作</p>
</blockquote>
<pre class="brush:php;toolbar:false;">import { initializeApp as initFirebaseApp } from "firebase/app";</pre>
<blockquote>
<p>未捕获的语法错误:不明确的间接导出:initializeApp</p>
</blockquote>
<p>这里的版本是"firebase": "^8.6.8"</p>