<p dir="auto">I've created a minimal repo to demonstrate the issue: <a href="https://github.com/shareup/deno-watch-stops-watching-bug">https://github.com/shareup/deno-watch-stops-watching-bug</a></p>
<p dir="auto">Deno version: 1.30.0<br>
OS: macOS 13.2, aarch64</p>
<p dir="auto">The first time a file outside the module graph is updated, the server restarts. The second and further times, files outside the module graph do not trigger a server restart anymore. Files in the module graph always trigger a restart.</p>
<p dir="auto">This worked correctly, I believe, in version 1.27.x – the server would restart if any watched file changed, even if it was outside the module graph, across server restarts.</p>
<p dir="auto">This is a regression between v1.29.2 and v1.29.3; likely caused by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1337388945" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/15466" data-hovercard-type="pull_request" data-hovercard-url="/denoland/deno/pull/15466/hovercard" href="https://github.com/denoland/deno/pull/15466">#15466</a>.</p>
<p dir="auto">To reproduce:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="echo 'a' &gt; file.txt
echo 'console.log(await Deno.readTextFile(&quot;file.txt&quot;))' &gt; cat.ts
deno run -A --watch=file.txt cat.ts &amp;
echo 'b' &gt;&gt; file.txt
echo 'c' &gt;&gt; file.txt
echo 'd' &gt;&gt; file.txt"><pre class="notranslate"><span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>a<span class="pl-pds">'</span></span> <span class="pl-k">&gt;</span> file.txt
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>console.log(await Deno.readTextFile("file.txt"))<span class="pl-pds">'</span></span> <span class="pl-k">&gt;</span> cat.ts
deno run -A --watch=file.txt cat.ts <span class="pl-k">&amp;</span>
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>b<span class="pl-pds">'</span></span> <span class="pl-k">&gt;&gt;</span> file.txt
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>c<span class="pl-pds">'</span></span> <span class="pl-k">&gt;&gt;</span> file.txt
<span class="pl-c1">echo</span> <span class="pl-s"><span class="pl-pds">'</span>d<span class="pl-pds">'</span></span> <span class="pl-k">&gt;&gt;</span> file.txt</pre></div>
<p dir="auto">On v1.29.2, each echo causes the watcher to trigger; on v1.29.3 and v1.30.0, only the first echo does.</p>