<p dir="auto"><strong>Note</strong>: This is a really strange bug, so I would like to ask you for patience while reading it.</p>
<p dir="auto"><strong>[Details]</strong><br>
First, I would like you to see this video because it will be hard to explain with only words:<br>
<a href="https://drive.google.com/file/d/11Z7_4z1KMzwYc55qCp41zOev8zjx7Ko7/view?usp=sharing" rel="nofollow">Click here to see video</a><br>
<strong>I have attached this video in .ZIP format at the end of the issue if you do not feel comfortable with google drive</strong></p>
<p dir="auto">--<br>
What you saw in this video is that a class with <strong>no imports whatsoever</strong> (I say this because <em>at first</em> I thought imports were making the HTTP dispatcher fail) is making the http dispatcher fail.<br>
It's been happening to <strong>new classes</strong> on my code no matter whether it has imports or no as you saw in the video.  I have spent more than a day to find the root of the problem in order to be able to record this video.<br>
I can create any class in any folder, and it will make the http dispatcher fail, no matter what the content of the class is.<br>
It is also happening to both static and non-static methods, it is also happening to classes without methods. so if I only import the class and as soon as I call it like this <code class="notranslate">MyClass;</code> (<strong>so no effect at all on the code</strong>), it will make the HTTP dispatcher fail.</p>
<p dir="auto"><strong>Update</strong>: It is happening not only with JS classes, but also empty defaults (<code class="notranslate">export default {}</code>) &amp; functions (<code class="notranslate">export function MyFunction() {}</code>), with any class name, with any method name...</p>
<p dir="auto"><strong>[Context]</strong><br>
It is impossible for me to provide a small context or reproducible context because I do not even know what the context is. It happens randomly to new classes, one class may cause the HTTP dispatcher fail, but another class may work just fine. When finding the causes and playing around with the code, I moved the class you saw in the video to a folder inside a folder inside a folder, and it worked fine, then I got the class out of the folder, and it started failing again: I say this just to demonstrate how random it is.</p>
<p dir="auto"><strong>[Additional]</strong><br>
I have wiped out my DENO_DIR, but it didn't do anything, the error was still being thrown.</p>
<p dir="auto">I didn't want to open this issue until being sure it was a real issue/bug. As per my conversation with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lucacasonato/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lucacasonato">@lucacasonato</a> where I share these same details, we agreed on the weirdness of this.</p>
<p dir="auto"><strong>[Stacktrace]</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Error: Another accept task is ongoing
    at unwrapResponse ($deno$/ops/dispatch_json.ts:42:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:93:10)
    at async ListenerImpl.accept ($deno$/net.ts:63:17)
    at async Server.acceptConnAndIterateHttpRequests (server.ts:212:14)
    at async MuxAsyncIterator.callIteratorNext (mux_async_iterator.ts:30:31)"><pre class="notranslate"><code class="notranslate"> Error: Another accept task is ongoing
    at unwrapResponse ($deno$/ops/dispatch_json.ts:42:11)
    at Object.sendAsync ($deno$/ops/dispatch_json.ts:93:10)
    at async ListenerImpl.accept ($deno$/net.ts:63:17)
    at async Server.acceptConnAndIterateHttpRequests (server.ts:212:14)
    at async MuxAsyncIterator.callIteratorNext (mux_async_iterator.ts:30:31)
</code></pre></div>
<p dir="auto"><strong>[Code details]</strong><br>
This is happening in <a href="https://github.com/mandarineorg/mandarinets">Mandarine Framework</a>. You can find the failing code in the branch <a href="https://github.com/mandarineorg/mandarinets/tree/feature/make-everything-a-proxy"><code class="notranslate">make-everything-a-proxy</code></a>.</p>
<ol dir="auto">
<li>Download the mentioned branch (make-everything-a-proxy)</li>
<li>Go to the root of it in your computer</li>
<li>Run <code class="notranslate">deno run --config tsconfig.json --allow-net --allow-read examples/example-1.ts</code></li>
</ol>
<p dir="auto"><code class="notranslate">OrmCoreDecoratorsProxy</code> which is the class that is making the HTTP dispatcher fail <strong>at this time</strong>, is being called in <strong><code class="notranslate">/orm-core/core/decorators/entityDecorator.ts</code></strong> Line 16. (Inside <em>decorator method</em> "Table")</p>
<p dir="auto"><code class="notranslate">OrmCoreDecoratorsProxy</code> is located in <strong><code class="notranslate">/orm-core/proxys/ormCoreDecorators.ts</code></strong></p>
<p dir="auto"><strong>I would like to mention</strong> that the decorator <code class="notranslate">Table</code> where the problem is happening as described before is not even being called in the file that's being ran (<code class="notranslate">examples/example-1.ts</code>), so the code is never processing <code class="notranslate">OrmCoreDecoratorsProxy</code>, the very very simple fact of putting it in the code is making the HTTP dispatcher fail somehow.</p>
<p dir="auto"><strong>[OS]</strong><br>
MacOS Mojave 10.14.6</p>
<p dir="auto"><strong>[Environment]</strong><br>
deno 1.1.2<br>
v8 8.5.216<br>
typescript 3.9.2</p>
<p dir="auto"><strong>Update</strong> After testing with many <em>versions of Deno</em>, this started happening in version <strong>1.0.3</strong> as it is not happening in <strong>1.0.2</strong></p>
<hr>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lucacasonato/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lucacasonato">@lucacasonato</a></p>
<p dir="auto"><a href="https://github.com/denoland/deno/files/4866989/screen-capture.3.webm.zip">screen-capture (3).webm.zip</a></p>
<p dir="auto">I've just started with <code class="notranslate">Deno v1.1</code>.<br>
I've tried to create my first class and whenever I try to instance it I get:<br>
<code class="notranslate">Uncaught Error: Another accept task is ongoing at unwrapResponse ($deno$/ops/dispatch_json.ts:43:11)</code><br>
It happens only if I use MySQL client before but It works if I run any MySQL query before <code class="notranslate">new MyClass</code>.</p>
<p dir="auto">MyClass.ts</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyClass {
   // empty
}
export default MyClass;"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span>
   <span class="pl-c">// empty</span>
<span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-v">MyClass</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">server.ts</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { Application } from &quot;https://deno.land/x/oak@v5.2.0/mod.ts&quot;
import { Client } from &quot;https://deno.land/x/mysql/mod.ts&quot;;
import { APP_HOST, APP_PORT } from &quot;./config.ts&quot;;
import router from './routes.ts'
import MyClass from &quot;./controllers/myclass.ts&quot;;

const app = new Application()

app.use(router.routes())
app.use(router.allowedMethods())

const db = await new Client().connect({
    //...
});

const myClass = new MyClass();
await app.listen(`${APP_HOST}:${APP_PORT}`);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Application</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/x/oak@v5.2.0/mod.ts"</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">Client</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/x/mysql/mod.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-c1">APP_HOST</span><span class="pl-kos">,</span> <span class="pl-c1">APP_PORT</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./config.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">router</span> <span class="pl-k">from</span> <span class="pl-s">'./routes.ts'</span>
<span class="pl-k">import</span> <span class="pl-v">MyClass</span> <span class="pl-k">from</span> <span class="pl-s">"./controllers/myclass.ts"</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Application</span><span class="pl-kos">(</span><span class="pl-kos">)</span>

<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">router</span><span class="pl-kos">.</span><span class="pl-en">routes</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">router</span><span class="pl-kos">.</span><span class="pl-en">allowedMethods</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span>

<span class="pl-k">const</span> <span class="pl-s1">db</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-k">new</span> <span class="pl-v">Client</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">connect</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c">//...</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">myClass</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">MyClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">APP_HOST</span><span class="pl-kos">}</span></span>:<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">APP_PORT</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I use theese flags:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno run --allow-env --allow-net server.ts"><pre class="notranslate"><code class="notranslate">deno run --allow-env --allow-net server.ts
</code></pre></div>
<hr>
<h3 dir="auto">Env</h3>
<p dir="auto">Linux Mint 19,<br>
Deno 1.1</p>