You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter Web部署Firebase后显示默认页面,如何解决?

Flutter Web部署Firebase后显示默认页面的问题解决

问题根源

你在执行firebase init hosting的过程中,当系统提示File build/web/index.html already exists. Overwrite?时选择了Yes,这会将Flutter编译生成的应用入口文件替换为Firebase的默认页面模板,导致部署后显示的不是你的HelloWorld应用。

修复步骤

  • 重新编译Flutter Web应用,生成正确的入口文件:
flutter build web
  • 直接重新部署到Firebase,无需再次初始化:
firebase deploy --only hosting

后续注意事项

如果后续需要重新初始化Firebase Hosting配置,遇到相同的文件覆盖提示时,务必选择No,保留Flutter构建生成的index.html文件,避免应用入口被替换。

内容的提问来源于stack exchange,提问作者polina-c

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 18:15:38