我最近将我的 Angular 5 项目更新为 Angular 6,并且我一整天都在尝试构建和部署。我的最新问题是导入问题 - 之前工作正常。
错误现在显示 cannot find module 'firebase'
在我的导入中。
最佳答案
对于 Angular 6+,按如下方式导入 firebase 核心和服务:
/*
* reduce the amount of code that your app uses by
* only including the features that you need.
*/
// import core firebase client (required)
import firebase from '@firebase/app';
// import Firebase Authentication (optional)
import '@firebase/auth';
// import Firebase Realtime Database (optional)
import '@firebase/database';
// import Cloud Firestore (optional)
import '@firebase/firestore';
Selenium official docs想要查询更多的信息。
关于angular - 从 Angular 6 更新开始,从 'firebase' 导入 * 作为 firebase 不再有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51470126/