本文介绍了在使用Firebase托管进行部署时,我得到了hosts.rewrites [0]与[subschema 0],[subschema 1]并不完全相同.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将应用程序部署到Firebase托管时,出现以下错误:

Deploying an application to Firebase hosting, I get the following error:

HTTP Error: 400, hosting.rewrites[0] is not exactly one from [subschema 0],[subschema 1]

这是通过简单的配置发生的,例如:

This occurs with a simple configuration like:

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

此配置在本地投放时有效.

This configuration does work when serving locally.

推荐答案

显然,该错误表明我应该在'index.html'前面放置一个'/'.然后,它适用于本地和远程部署.

Apparently, the error indicates that I should put a '/' in front of 'index.html'. Then it works for local and remote deploy.

这篇关于在使用Firebase托管进行部署时,我得到了hosts.rewrites [0]与[subschema 0],[subschema 1]并不完全相同.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 21:54