The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

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

TODO: Pull subtitle into page object

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/

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

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

-- p

Was doing some S3 work where I had `fs.writeFile` that worked locally but not on the server.

-- p

Realized that it was causing a race condition with sharp.

-- p

Fix was to flip over to using `fs.writeFileSync` so the process didn't move on until the file was finished writing

-- p

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


-- categories
-- Miscellaneous

-- metadata
-- date: 2021-11-04 17:01:17
-- id: 20eofbkf
-- status: published
-- type: post
-- SCRUBBED_NEO: false
-- site: aws