Image after upload does not exist without restart

I save my image with writeFile but i can’t load it in my browser.
Except if i restart (npm run dev || node build/index)

await writeFile("static/img/tmp/"+now+".jpg", contentReplace, 'base64');

I use SvelteKit with node-adapter, i don’t want to use s3 or anything else because is only for uploading one file the be deleted after an other operation.

I’ve tried to save my image in many different folders:

  • build/client/img/tmp
  • src/lib/images/tmp
  • static/img/tmp