AngularDart 5 和 Firebase 部署 [英] AngularDart 5 and Firebase deployment

查看:19
本文介绍了AngularDart 5 和 Firebase 部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的 AngularDart 5 网络应用部署到 Firebase.这些是我遵循的步骤:

I’m trying to deploy my AngularDart 5 web app to Firebase. These are the steps I followed:

  1. 我使用命令 pub run build_runner build --output build 构建了我的应用.
  2. 我启动了命令 firebase init 并将 web 文件夹设置为公共文件夹.
  3. 我使用命令 firebase deploy 部署了我的网络应用.
  1. I builded my app with the command pub run build_runner build --output build.
  2. I launched the command firebase init and setted web folder as the public folder.
  3. I deployed my web app with the command firebase deploy.

问题是当我打开网站时,我发现只有一个空白页面.

⚠ The problem is that when I open the website I find only a blank page.

❔我做错了什么?

谢谢!

是的,我仍然遇到这个问题.我的 firebase.json 的内容是:

Yes, I am still having this issue. The content of my firebase.json is:

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

我不知道它是否有帮助,但我的 pubspec.yaml 文件是:

I don’t know if it helps, but my pubspec.yaml file is:

name: angular_app
description: Angular App
version: 0.0.1

environment:
  sdk: '>=2.0.0-dev.63.0 <2.0.0'

dependencies:
  sass_builder: ^2.0.2
  angular: ^5.0.0-alpha+15
  angular_forms: ^2.0.0-alpha+7
  angular_router: ^2.0.0-alpha+14

dev_dependencies:
  angular_test: ^2.0.0-alpha+13
  build_runner: ^0.8.9
  build_test: ^0.10.2+5
  build_web_compilers: ^0.4.0+4
  test: ^1.0.0

当我在 firebase 上部署或使用 firebase serve 提供应用程序时,我只看到正在加载...".

When I deploy on firebase or when I serve the app with firebase serve, I see only "Loading...".

感谢您的帮助!

推荐答案

  • 在您的第 3 步中,您需要使用 firebase deploy 进行部署而不是发布.
  • 在您的 firebase.json 文件中,上面显示的 hosting.public 条目只是 "web" 但您的构建输出目录是建造".条目应该是build/web".
  • 您是否在 index.html 中设置了 ?如果是这样,哪个 href 值?
  • 您写道,当您服务时,您只会看到正在加载...".然后打开 JavaScript 控制台.您是否看到任何错误消息?
    • In your step 3, you need to use firebase deploy to deploy rather than pub.
    • In your firebase.json file, the hosting.public entry shown above is just "web" but your build output directory is "build". The entry should probably be "build/web".
    • Are you setting <base href> in your index.html? If so, to which href value?
    • You wrote that when you serve you only see "Loading...". Open then JavaScript console. Do you see any error messages?
    • 这篇关于AngularDart 5 和 Firebase 部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆