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

Angular项目部署Firebase后页面空白无报错问题求助

Angular项目部署Firebase后显示空白页面(无报错)

我已将Angular项目部署至Firebase,部署过程未出现任何报错,但访问网站时仅显示空白页面,未收到错误提示。我的部署步骤如下:

  • 执行命令:ng build --configuration "production"
  • 执行命令:firebase init
  • 输入Y确认继续操作
  • 选择Hosting选项(配置Firebase Hosting,可选择设置GitHub Action部署)
  • 设置公开目录为dist/estelaa
  • 输入y配置为单页应用(将所有URL重写至/index.html)
  • 输入n不设置GitHub自动构建与部署
  • 输入n不覆盖已存在的dist/estelaa/index.html
  • 执行命令:firebase deploy

index.html 内容

<!doctype html>
<html lang="en">
<head>
  <link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css"
/>
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
  <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.js"></script>
<script src="https://static.iyzipay.com/plugins/v1/iyzico-buttons.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Orbitron&display=swap" rel="stylesheet">

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
  <meta charset="utf-8">
  <title>Calienna Studio | Official Website</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="assets/favicon.jpg">
</head>
<body>

  <app-root class="asd"></app-root>
</body>
</html>

firebase.json 内容

{
  "functions": {
    "predeploy": "npm --prefix \"$RESOURCE_DIR\" run build",
    "source": "functions"
  },
  "database": {
    "rules": "database.rules.json"
  },
  "storage": {
    "rules": "storage.rules"
  },
  "hosting": {
    "public": "dist/estelaa",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

内容的提问来源于stack exchange,提问作者pennylies

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.08 01:55:20