nodejs / nodejs/node

--watch restarts only once

Aperta
#54,774 17 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

libuv stale watch-mode
Lingua principale
JavaScript
Stelle
122k
Fork
37.3k
Merge medio
4g 2h
PR unite (30g)
283

Descrizione

Version

v20.15.1

Platform
Linux derby 6.6.46-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2024-08-16 08:05:54 x86_64 Linux
Subsystem

No response

What steps will reproduce the bug?

f.js contains only console.log('hello')

node --watch f.js
hello
Completed running 'f.js'

Change f.js to console.log('hello world')

Restarting 'f.js'
hello world
Completed running 'f.js'

Change f.js again, e.g. console.log('this change will not restart watcher')
No change in the watch output.

(I'm changing the file outside of the debounce/throttle period)

How often does it reproduce? Is there a required condition?

It happens every time.

What is the expected behavior? Why is that the expected behavior?

I would expect that --watch would restart after every write to f.js, not just after the first change made to the file.

What do you see instead?

--watch only seems to restart after making the first change to the file.

Additional information

Also seeing this problem on Termux for Android node v22.5.1

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il problema con node --watch f.js, modificando il file più di una volta al di fuori del periodo di debounce/throttle. Traccia il punto di ingresso di --watch e la gestione del suo riavvio; il lavoro è completato quando ogni scrittura successiva in f.js riavvia il processo e il comportamento è verificato nell'ambiente segnalato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, nodejs
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
64/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.