LoginSignup
6
1

More than 3 years have passed since last update.

【Firebase】Reactのcreate-react-appで作ったWEBアプリをデプロイする際の注意点

Posted at

build後、firebaseにデプロイしたらコンソールログでエラーが出た

エラー内容はこんな感じです。
/%PUBLIC_URL%/favicon.ico:1 Failed to load resource: the server responded with a status of 400 ()

firebase.jsonを修正すれば解決!

firebase.jsonのホストティング対象はデフォルトではpublicになっています。

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

こいつの"public": "public" を "public": "build"に変更すれば解決しました。

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

こういう系ってハマるととことんハマりますよね。。。

6
1
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
1