<p dir="auto">Reproduction:</p>
<ul dir="auto">
<li>Create and open a file that contains any warnings or errors from deno, let's it be <code class="notranslate">a.ts</code>, for example.</li>
<li>Add the file to the exclude list in <code class="notranslate">deno.json</code>:</li>
</ul>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;lint&quot;: {
   &quot;files&quot;: {
     &quot;exclude&quot;: [&quot;a.ts&quot;]
   }
 }"><pre class="notranslate"><span class="pl-ent">"lint"</span>: {
   <span class="pl-ent">"files"</span>: {
     <span class="pl-ent">"exclude"</span>: [<span class="pl-s"><span class="pl-pds">"</span>a.ts<span class="pl-pds">"</span></span>]
   }
 }</pre></div>
<p dir="auto">Config re-applies but diagnostics from <code class="notranslate">a.ts</code> do not disappear.<br>
If we edit <code class="notranslate">deno.json</code> before opening the file - it works as should.</p>
<h3 dir="auto">Description</h3>
<p dir="auto">The issue below happens in these scenarios:</p>
<ol dir="auto">
<li>Running the server.ts with --watch and modifying the server.ts file triggering a restart.</li>
<li>Running the same file twice in separate terminal windows</li>
</ol>
<p dir="auto">Both of these cases result in the exact same message.</p>
<p dir="auto"><strong>I added reproduce steps below the stack trace</strong></p>
<h3 dir="auto">Error Log W/ RUST_BACKTRACE</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.25.0
Args: [&quot;deno&quot;, &quot;run&quot;, &quot;-A&quot;, &quot;--unstable&quot;, &quot;--watch&quot;, &quot;test-server.ts&quot;]

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ext/flash/lib.rs:1316:42
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   4: &lt;extern &quot;C&quot; fn(A0) .&gt; R as v8::support::CFnFrom&lt;F&gt;&gt;::mapping::c_fn
   5: __ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
   6: __ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace."><pre class="notranslate"><code class="notranslate">============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.25.0
Args: ["deno", "run", "-A", "--unstable", "--watch", "test-server.ts"]

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ext/flash/lib.rs:1316:42
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   4: &lt;extern "C" fn(A0) .&gt; R as v8::support::CFnFrom&lt;F&gt;&gt;::mapping::c_fn
   5: __ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
   6: __ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</code></pre></div>
<h3 dir="auto">Error Log original</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.25.0
Args: [&quot;deno&quot;, &quot;run&quot;, &quot;-A&quot;, &quot;--unstable&quot;, &quot;--watch&quot;, &quot;test-server.ts&quot;]

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ext/flash/lib.rs:1316:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace"><pre class="notranslate"><code class="notranslate">============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos x86_64
Version: 1.25.0
Args: ["deno", "run", "-A", "--unstable", "--watch", "test-server.ts"]

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ext/flash/lib.rs:1316:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
</code></pre></div>
<h3 dir="auto">Exact Repro Steps</h3>
<p dir="auto"><strong>Scenario 1: --watch</strong></p>
<ol dir="auto">
<li>Create new project folder <code class="notranslate">mkdir project-test-watch</code></li>
<li>Navigate to project folder <code class="notranslate">cd project-test-watch</code></li>
<li>Create server.ts file</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="echo &quot;
Deno.serve(
  (request) =&gt; {
    console.log('url', request.url);
    const url = new URL(request.url);
    console.log('url', url);
    return new Response('hehe');
  },
  { port: 4500 },
);
&quot; &gt; server.ts"><pre class="notranslate"><code class="notranslate">echo "
Deno.serve(
  (request) =&gt; {
    console.log('url', request.url);
    const url = new URL(request.url);
    console.log('url', url);
    return new Response('hehe');
  },
  { port: 4500 },
);
" &gt; server.ts
</code></pre></div>
<ol start="4" dir="auto">
<li>Start server in watch mode <code class="notranslate">RUST_BACKTRACE=1 deno run -A --unstable --watch server.ts</code></li>
<li>Modify the server.ts file <code class="notranslate">echo "\n // update file :)" &gt;&gt; server.ts</code><br>
EXPECTED:<br>
Server Restarts fine<br>
ACTUAL:<br>
The error above shows</li>
</ol>
<p dir="auto"><strong>Scenario 2: Running file twice</strong></p>
<ol dir="auto">
<li>Follow Scenario 1's steps 1-3;</li>
<li>Start server <code class="notranslate">RUST_BACKTRACE=1 deno run -A --unstable server.ts</code> <strong>--watch is not needed</strong></li>
<li>Open up a another terminal window</li>
<li>Run the same deno script to start the server (Make sure the other one is still running) <code class="notranslate">RUST_BACKTRACE=1 deno run -A --unstable server.ts</code><br>
EXPECTED:<br>
Some error akin to <code class="notranslate">port already in use</code><br>
ACTUAL<br>
The Second tab from step 4 outputs the error above.</li>
</ol>