1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Firebaseにdeployする際、沼ったのでメモ

Last updated at Posted at 2021-06-02

reactをFirebaseにdeployする際エラーで沼った

エラー内容

Reduce of empty array with no initial value
    at Array.reduce (<anonymous>)
    at release (/Users/ユーザネーム/.nodebrew/node/v14.6.0/lib/node_modules/firebase-tools/lib/deploy/functions/release.js:47:10)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

エラーの箇所を確認してもさっぱりわからず、、、

functionのデプロイ時でエラーが出ていることは分かったので,functionを避け

firebase deploy --only hosting

これで一応deployはできた。
解決はできていないので原因が気になります。。

##追記 (6/7)

firebase.jsonのこの部分がおかしかったみたいです。

"functions": {
  "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint",
      "npm --prefix \"$RESOURCE_DIR\" run build"
   ]
},

こちらに変更すると上手く行きました!!

  "functions": {
    "predeploy": "npm --prefix functions run build"  
  },

functionsでエラーが出ていたからしっかりfunctionsを見直すべきでした。
恐らく firebase init の段階で間違ったのかな?

ちゃんとdeployできて良かったです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?