I have a small project with a scheduled Netlify function updating a dynamic twitter banner.
The function is fetching my most recent 4 followers from the twitter API and adding their profile picture to my banner.
I am doing a bit of manipulation on the profile pictures, and overlaying them to the banner using the sharp
library.
So I need to write a few files to the tmp folder (as I understand it, I can write to this on AWS - where the rest of the filesystem is read-only).
I am struggling a bit to debug this locally, as the Netlify CLI doesn’t have a read-only filesystem in the same way as on AWS Lambda.
My function is working just fine locally on my Windows machine (testing with the netlify functions:invoke
command) - but is failing when deployed on Netlify with the error: unix error: Read-only file system
I am simply unsure of the exact placement of the tmp folder on AWS?
Should it be placed directly inside the functions folder, inside the subfolder of the function: eg.: functions/updateTwitterbanner/tmp
or something completely different?
My code can be seen on:
I have tried some different paths to the tmp
folder, but am struggling, as I haven’t found a way to debug this locally.