nodejs / nodejs/node

--watch restarts only once

Offen
#54,774 17 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

libuv stale watch-mode
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem mit node --watch f.js zu reproduzieren, indem du die Datei mehr als einmal außerhalb des Debounce-/Throttle-Zeitraums änderst. Verfolge den --watch-Einstiegspunkt und dessen Neustartbehandlung; abgeschlossen ist die Aufgabe, wenn jedes nachfolgende Schreiben in f.js den Prozess neu startet und das Verhalten in der gemeldeten Umgebung verifiziert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, nodejs
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
64/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.