I tried updating some cloud functions to Firebase that were working earlier but I'm getting odd errors. These are the errors I get for each of my functions in my main index.js file.
Deployment error.
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.
When I look at my logs I see these errors.
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Function cannot be initialized.
The documentation at the next suggested resource is very generic. How do I do additional logging to find the problem? I can run my code locally fine so I'm not sure why it won't deploy to Firebase.
I believe the problem may be from requiring a JSON file as a module. This works fine locally but does Firebase support this feature?
const config = require('./config.json');