LoginSignup
6
4

More than 3 years have passed since last update.

【Firebase】Vueプロジェクトでfirebase deploy した時に、Failed to load resource: the server responded with a status of 400 () が出た時の対処法

Posted at

vue create [project] で作ったwebアプリをbuild後、firebase にデプロイしたらconsole logでエラー発生

手順は、
firebase deploy --only hosting 後、指定された firebaseapp.comを開いても、ブランクページが表示される。

consoleのエラー内容は、
Failed to load resource: the server responded with a status of 400 ()

firebase.jsonを変更すればok

npm run build でroot配下に、distディレクトリが自動生成された事を確認後、

firebase.json
{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }

ここの public: "public"public: "dist に変えるだけ。

修正後のfirebase.json はこちら

firebase.json
{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4