Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Nodejs sharp error - Input file contains unsupported image format might be a race condition

Was doing some S3 work where I had `fs.writeFile` 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 `fs.writeFileSync` so the process didn't move on until the file was finished writing

- https://www.geeksforgeeks.org/node-js-fs-writefilesync-method/