firebase - 当我运行 firebase serve --only 托管时,功能托管不起作用
问题描述
我无法同时在本地模拟托管和功能。只有函数有效。
node -v
v10.15.3
firebase -V
6.9.0
当我跑步时,firebase serve --only hosting,functions
我得到:
✔ functions: Using node@10 from host.
✔ functions: Emulator running at http://localhost:5001
只有函数开始模拟。并且网页不起作用。顺便说一下,默认端口是 5000。
当我跑步时,firebase serve
我得到:
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
和我运行时得到的一样:firebase serve --only hosting
然后一个网页运行良好,但它无法访问为该网页提供 API 的函数。
我希望当我firebase serve --only hosting,functions
同时运行托管和功能时,它们将开始在同一个端口上进行模拟。在我使用 4.x 版本的 firebase-tools 之前,它曾经可以工作
解决方案
firebase-tools 6.9.0 中有一个回归。降级作为临时修复。
npm i -g firebase-tools@6.8.0
https://github.com/firebase/firebase-tools/issues/1242
推荐阅读
- java - 二叉搜索树中的方向
- php - 如何在日期拉起时显示 NO 值而不是 1970 年 1 月 1 日
- scala - 发现:需要单位:for循环的List [Int]类型不匹配错误
- jquery - 如何在打印 Power BI 嵌入式报表时添加自定义徽标(页眉和页脚)?
- javascript - 从产生布尔乘积的前一个函数运行“statusFlag”的函数
- python - 使用 imshow python 在一个目录中显示多个图像
- probability - 估计概率
- html - 无法将元素拖放到
- 使用 selenium Actions 类方法
- ios - Xcode 从 10.2 降级到 10.1 后不显示模拟器
- amazon-web-services - 为备用 PUT 操作配置 s3 事件