[wp-trac] [WordPress Trac] #63605: npm run dev: file watcher sometimes deletes uploaded files
WordPress Trac
noreply at wordpress.org
Fri Jun 20 12:29:43 UTC 2025
#63605: npm run dev: file watcher sometimes deletes uploaded files
------------------------------+-----------------------------
Reporter: siliconforks | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
I've noticed that, when the `npm run dev` command is running the file
watcher, if you try to upload a file, the file watcher will sometimes
delete the file immediately after it has been created.
Unfortunately it seems to happen only intermittently, and I haven't found
a reliable way of reproducing it consistently. I've seen it happen
sometimes when uploading an image to the Media Library, and I've also seen
it happen when uploading a font file using the block editor. You can see
an example of the latter here:
https://core.trac.wordpress.org/ticket/63568#comment:20
When it does happen, the output from `npm run dev` will look something
like this:
{{{
Running "_watch" task
...
>> File "src/wp-content/uploads/fonts/O-Reilly-Sans-Regular.ttf" added.
Running "clean:dynamic" (clean) task
>> 1 path cleaned.
}}}
The `1 path cleaned` indicates that the file watcher just deleted a file
for some reason (normally it says `0 paths cleaned`).
I searched Trac to see whether this has been reported before, and I found
#49275 which is kind of a different issue but appears to be similar. The
author made the following suggestion which seems like it would fix both
issues:
> Is there a way to maybe only "watch" the wp-content files that core has
and nothing else?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63605>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list