我开始将我的firstore项目迁移到web v9。使用来自以下链接的步骤:https://firebase.google.com/docs/web/setup?sdk_version=v9#add-sdks-initialize
<script src="https://www.gstatic.com/firebasejs/9.0.0-beta.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0-beta.2/firebase-analytics-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0-beta.2/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.0.0-beta.2/firebase-firestore-compat.js"></script>
<script>
import firebase from "firebase/compat/app";
//const firebase = require('firebase/compat/app');
var firebaseConfig = {
apiKey: "zaSy...opjQ6GQ3",
authDomain: "...firebaseapp.com",
projectId: "...",
storageBucket: "...appspot.com",
messagingSenderId: "..049",
appId: "1:645243..9a",
measurementId: "..Q3Y.."
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
1?. 错误 "Uncaught SyntaxError: Cannot use import statement outside a module"(未捕获的语法错误:无法在模块外部使用导入语句)
2?. 模块化的CDN在哪里 - 我不想使用兼容SDK。
3?. 在此页面上,有关于Firebase JS SDK可用性的信息(从CDN获取),但它看起来是针对v8版本的 - v9版本在哪里?
请问有示例代码吗?