4
2

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.

cloud functionsをデプロイしたらFunction failed on loading user codeといわれてデプロイできない問題

Posted at

こんにちは。もぐめっとです。
今日はcloud functionsをデプロイしようとしたらこんな事言われたので軽くメモをしておきます。

Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.

原因

ターミナルのログ見てもさっぱりわからないのでcloud functions側のログを見たら答えが書いてありました。

Detailed stack trace: Error: Cannot find module 'child-process-promise' 
Did you list all required modules in the package.json dependencies? 

child-process-promiseがdevDependenciesに入っているのがダメだったみたいですね。
素直にdependenciesに入れ直したら治りました。

npm i child-process-promise --save

教訓

エラーログはちゃんと読もう!

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?