首页 > 解决方案 > 角度 Firebase 托管不起作用

问题描述

我正在按照本教程构建 Angular 应用程序。我在 firebase 上创建了项目并成功部署了它。

i  deploying hosting
i  hosting: preparing dist/test-app directory for upload...
+  hosting: 7 files uploaded successfully

  • Deploy complete!

Project Console: https://console.firebase.google.com/project/test-app-38199/overview Hosting URL: https://test-app-38199.firebaseapp.com

我的 firebase.json 是这样的:

{
    "hosting": {
        "public": "dist/test-app",
        "ignore": [
            "firebase.json",
            "**/.*",
            "**/node_modules/**"
        ],
        "rewrites": [
            {
                "source": "**",
                "destination": "/index.html"
            }
        ]
    }
}

但是在我的浏览器中,我看到的是:

在此处输入图像描述

标签: angularfirebasedeployment

解决方案


我遇到了类似的问题,Angular 应用程序不再与 Firebase 兼容。我可以在其他任何地方托管我的 Angular 应用程序并且它运行良好,但是当部署到公用文件夹时,该应用程序将无法运行。就好像 Google 故意禁用 Angular 一样。


推荐阅读