LoginSignup
3
0

More than 5 years have passed since last update.

Cloud Functions for Firebase でdeploy成功してるのに実際の動作は置き換わっていなかった

Posted at

何が起きた?

Cloud Functions for Firebase を触りながら勉強していた。動作を変えてみようと思ってコードを編集し、以下のコマンドで再びdeployした。

firebase deploy --only functions

以下のような出力 (一部省略) が得られたので「やったーDeployできた〜」と思った。

✔  functions: Finished running predeploy script.
i  functions: ensuring necessary APIs are enabled...
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (50.52 KB) for uploading
✔  functions: functions folder uploaded successfully
i  functions: updating function {MyFunctionName}...
✔  functions[createCheckEvent]: Successful update operation.

動作確認してみたら「あれ?さっきと何も変わってない!(T_T)」

その後 firebase logout firebase login とかいろいろ試して再度deployするも、やはり成功するが動作は変わらない。

原因

以下のように違う階層のファイルをimportしていたのが原因だった。

import Hoge from "../../client/src/Hoge"

importしていたのは interface 定義なのだが、とりあえずimportをやめて index.ts に定義をコピペしたら動いた。

ただし、これは絶対に正しい対処方法ではないと思う。ひとまず直接的な原因はわかったのでここまで。

おわりに

初めてのQiita投稿。へっぽこですが、未来の自分と願わくば誰かの助けになればいいな、と思いながらちまちま投稿していくことにします。

3
0
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
3
0