Nodejs sharp error - Input file contains unsupported image format might be a race condition
Was doing some S3 work where I had [TODO: Code shorthand span ] that worked locally but not on the server.
Realized that it was causing a race condition with sharp.
Fix was to flip over to using [TODO: Code shorthand span ] so the process didn't move on until the file was finished writing
- https : //www.geeksforgeeks.org/node - js - fs - writefilesync - method/