<p dir="auto">When I bundle the serve example in the homepage:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { serve } from &quot;https://deno.land/std@0.50.0/http/server.ts&quot;;
const s = serve({ port: 8000 }); 
console.log(&quot;http://localhost:8000/&quot;);
for await (const req of s) {
  req.respond({ body: &quot;Hello World\n&quot; }); 
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">serve</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/std@0.50.0/http/server.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-en">serve</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">port</span>: <span class="pl-c1">8000</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> 
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"http://localhost:8000/"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">for</span> <span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">req</span> <span class="pl-k">of</span> <span class="pl-s1">s</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-s1">req</span><span class="pl-kos">.</span><span class="pl-en">respond</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">body</span>: <span class="pl-s">"Hello World\n"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> 
<span class="pl-kos">}</span></pre></div>
<p dir="auto">with <code class="notranslate">deno bundle</code> command, the output script doesn't work with <code class="notranslate">deno run</code>. It includes the SyntaxError at for-await loop:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno bundle serve.ts &gt; serve.js
$ deno run serve.js 
error: Uncaught SyntaxError: Unexpected reserved word
        for await (const req of s) {
            ~~~~~
    at file:///Users/kt3k/3/deno/serve.js:5467:13"><pre class="notranslate"><code class="notranslate">$ deno bundle serve.ts &gt; serve.js
$ deno run serve.js 
error: Uncaught SyntaxError: Unexpected reserved word
        for await (const req of s) {
            ~~~~~
    at file:///Users/kt3k/3/deno/serve.js:5467:13
</code></pre></div>
<p dir="auto">Strangely that for-await loop appears inside a non-async function and it seems causing the error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ RUST_BACKTRACE=1 DENO_NODE_COMPAT_URL=file:///Users/me/dev/deno_std/ deno run --watch --unstable -A main.ts"><pre class="notranslate"><code class="notranslate">$ RUST_BACKTRACE=1 DENO_NODE_COMPAT_URL=file:///Users/me/dev/deno_std/ deno run --watch --unstable -A main.ts
</code></pre></div>
<div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import Koa from &quot;npm:koa&quot;;
import KoaRouter from &quot;npm:@koa/router&quot;;
import bodyparser from &quot;npm:koa-bodyparser&quot;;

const app = new Koa();
const router = new KoaRouter();

router.get(&quot;/&quot;, (context) =&gt; {
  context.status = 200;
});

app.use(bodyparser());
app.use(router.routes());

app.listen(3000);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-smi">Koa</span> <span class="pl-k">from</span> <span class="pl-s">"npm:koa"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-smi">KoaRouter</span> <span class="pl-k">from</span> <span class="pl-s">"npm:@koa/router"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">bodyparser</span> <span class="pl-k">from</span> <span class="pl-s">"npm:koa-bodyparser"</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-smi">Koa</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">router</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">KoaRouter</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">router</span><span class="pl-kos">.</span><span class="pl-en">get</span><span class="pl-kos">(</span><span class="pl-s">"/"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">context</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-c1">status</span> <span class="pl-c1">=</span> <span class="pl-c1">200</span><span class="pl-kos">;</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-en">bodyparser</span><span class="pl-kos">(</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">routes</span><span class="pl-kos">(</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">listen</span><span class="pl-kos">(</span><span class="pl-c1">3000</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<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 aarch64
Version: 1.25.0
Args: [&quot;/Users/dimgl/.deno/bin/deno&quot;, &quot;run&quot;, &quot;--watch&quot;, &quot;--unstable&quot;, &quot;-A&quot;, &quot;main.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: deno_core::runtime::JsRuntime::poll_event_loop
   5: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: deno::run_command::{{closure}}
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: deno::main::{{closure}}
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno_runtime::tokio_util::run_local
  12: deno::main
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 aarch64
Version: 1.25.0
Args: ["/Users/dimgl/.deno/bin/deno", "run", "--watch", "--unstable", "-A", "main.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: deno_core::runtime::JsRuntime::poll_event_loop
   5: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   6: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   7: deno::run_command::{{closure}}
   8: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   9: deno::main::{{closure}}
  10: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: deno_runtime::tokio_util::run_local
  12: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
</code></pre></div>
<p dir="auto">Run this then save the file. It will immediately panic.</p>