Closed viewee22 closed 1 year ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
I solved it. The reason was that I did not install the sharp package from the functions folder, but from the project folder. Installing the Sharp package in the functions folder correctly resolved the error. It was a problem that occurred when the package was used without installation.
@viewee22 Thank you for coming back and helping us shed light into your issue. I'm closing the issue for now, but feel free to open up a new one if you have any other problem.
Hey! To anyone who stumbles upon this: this can be also caused by the package not matching your functions' node level. I had my local node to be >20 so my sharp package was working with the emulator, but not when I deployed. Turns out my functions' node engine was 16 which was not supported by the version of the sharp package I was using.
If you cannot set your functions' node level high enough, try updating your firebase cli global install.
Related issues
[Error] V2 functions deployment fails with error in cloud run container service container fails to start #1131 https://github.com/firebase/firebase-functions/issues/1131
[REQUIRED] Version info
node:
v18.14.0
firebase-functions:
4.3.1
firebase-tools:
9.20.0
firebase-admin:
11.8.0
[REQUIRED] Test case
Cloud Storage trigger quickstart: Thumbnail generator https://github.com/firebase/functions-samples/blob/python-ci/Node/quickstarts/thumbnails/functions/index.js
[REQUIRED] Steps to reproduce
I tried above quickstart tutorial.
[REQUIRED] Expected behavior
Deploy the gen2 firebase cloud function successefully and error free
[REQUIRED] Actual behavior
Were you able to successfully deploy your functions?
no