I added firebase-functions as a dependency to my project (ie. the project level package.json, it was already in the functions package.json). I don't understand why this was necessary though as the function was already deployed and working.