我无法将firebasejs 4.0与angular cli项目集成,我的步骤是
ng new firebasetest
cd firebasetest
ng serve ==> works fine
只需添加
<script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script>
到index.html并运行ng服务 有错误
TypeError: __webpack_require__(16) is not a function. (In '__webpack_require__(16)(function(){
rApply(function(){});
})', '__webpack_require__(16)' is an instance of Object)
websocket.js:11TypeError: undefined is not an object (evaluating 'process.env.NODE_ENV')
如何解决这个问题?
答案 0 :(得分:0)
假设您已经插入了下面的完整代码段,请按照文档进行操作,无论如何也不适合我!无法从角度4 cli应用程序的firebase获取引用,也许可能是打字设置,我没有完成。
<script src="https://www.gstatic.com/firebasejs/4.0.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
firebase.initializeApp(config);
</script>
&#13;