<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let abortController = new AbortController()
abortController.abort()
await fetch(&quot;https://www.blockchain.com/ticker&quot;, { signal: abortController.signal }).catch(console.log)"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">abortController</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">AbortController</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-s1">abortController</span><span class="pl-kos">.</span><span class="pl-en">abort</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">await</span> <span class="pl-en">fetch</span><span class="pl-kos">(</span><span class="pl-s">"https://www.blockchain.com/ticker"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">signal</span>: <span class="pl-s1">abortController</span><span class="pl-kos">.</span><span class="pl-c1">signal</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">catch</span><span class="pl-kos">(</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">The web browser (Google Chrome 84.0.4147.125) will output the correct result:<br>
--&gt; DOMException: The user aborted a request.</p>
<h2 dir="auto">But the Deno (1.2.3) will not output anything:</h2>
<p dir="auto">According to the Web API Standard Documentation:<br>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/AbortController" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/AbortController</a><br>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal</a><br>
[Note: When abort() is called, the fetch() promise rejects with a DOMException named AbortError.]</p>
<p dir="auto">Because of Deno is aim to implementing Web APIs on server side, So the problem is on Deno.</p>
<p dir="auto">I hope this bug can be fix as soon as possible, because this is the recommeded method to abort the fetch at the Web API Standard Documentation<br>
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API</a><br>
(See "Aborting a fetch")</p>
<p dir="auto">Reference: <a href="https://developers.google.com/web/updates/2017/09/abortable-fetch" rel="nofollow">https://developers.google.com/web/updates/2017/09/abortable-fetch</a></p>
<p dir="auto">Also <code class="notranslate">Request</code> should have a <code class="notranslate">signal</code> property.</p>