[wp-trac] [WordPress Trac] #63605: npm run dev: file watcher sometimes deletes uploaded files

WordPress Trac noreply at wordpress.org
Fri Jun 20 13:12:30 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            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+------------------------------

Comment (by SirLouen):

 Following the conversation from this point:

 Replying to
 [https://core.trac.wordpress.org/ticket/63568?replyto=25#comment:25
 siliconforks]:
 > Replying to
 [https://core.trac.wordpress.org/ticket/63568?replyto=25#comment:24
 wildworks]:
 > > That's right. I've tried it in various environments, but the problem
 seems to occur when running the `wordpress-develop` repository by running
 `npm run dev`. This issue may need to be investigated in more depth in a
 separate ticket.
 >
 > I just created ticket #63605 for this issue.

 I was unable to reproduce this with this env vars

 === Environment
 - WordPress: 6.9-alpha-60093-src
 - PHP: 8.2.28
 - Server: nginx/1.27.5
 - Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
 - Browser: Chrome 137.0.0.0
 - OS: Windows 10/11
 - Theme: Twenty Twenty-Five 1.2
 - MU Plugins: None activated

 What was frustrating me was this message: `Warning: Maximum call stack
 size exceeded`
 That after a while ended in a `FATAL ERROR: Reached heap limit Allocation
 failed - JavaScript heap out of memory`

 I commented in Slack and @desrosj told me that having a lot of plugin was
 correlated with this error (just having the plugins, not even activated).
 So I moved all my plugins (~50) away from the folder, and the problem has
 been solved

 Now I upload the font and:

 {{{
 >> File "src/wp-content/uploads/fonts/O-Reilly-Sans-Regular.ttf" added.

 Running "clean:dynamic" (clean) task
 >> 0 paths cleaned.

 Running "copy:dynamic" (copy) task


 Running "_watch" task
 Completed in 0.027s at Fri Jun 20 2025 15:05:06 GMT+0200 (Central European
 Summer Time) - Waiting...
 }}}

 Then I removed the font, uploaded again and:

 {{{
 >> File "src/wp-content/uploads/fonts/O-Reilly-Sans-Regular.ttf" added.

 Running "clean:dynamic" (clean) task
 >> 1 path cleaned.

 Running "copy:dynamic" (copy) task


 Running "_watch" task
 Completed in 0.023s at Fri Jun 20 2025 15:07:28 GMT+0200 (Central European
 Summer Time) - Waiting...
 }}}

 Note the difference?

 In the first one it says: 0 paths cleaned
 In the second one it says: 1 paths cleaned

 Not sure, but the problem could be somewhere around here

 {{{
 all: {
         files: [
                 SOURCE_DIR + '**',
                 '!' + SOURCE_DIR + 'js/**/*.js',
                 // Ignore version control directories.
                 '!' + SOURCE_DIR + '**/.{svn,git}/**'
         ],
         tasks: ['clean:dynamic', 'copy:dynamic'],
         options: {
                 dot: true,
                 spawn: false
         }
 },
 'js-enqueues': {
         files: [SOURCE_DIR + 'js/_enqueues/**/*.js'],
         tasks: ['clean:dynamic', 'copy:dynamic-js', 'uglify:dynamic'],
         options: {
                 dot: true,
                 spawn: false
         }
 },
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63605#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list