<p dir="auto">I trying <code class="notranslate">Native HTTP/2</code> web server.</p>
<p dir="auto">I catch exception when run <a href="https://deno.com/blog/v1.9#native-http%2F2-web-server" rel="nofollow">Deno v1.9 Native HTTP/2</a> sample code with debug log.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const body = new TextEncoder().encode(&quot;Hello World&quot;);
for await (const conn of Deno.listen({ port: 8000 })) {
  (async () =&gt; {
    for await (const res of Deno.serveHttp(conn)) {
      console.log(res);                     // &lt;------- Insert debug log.
      res.respondWith(new Response(body));
    }
  })();
}"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">body</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">TextEncoder</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">encode</span><span class="pl-kos">(</span><span class="pl-s">"Hello World"</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">conn</span> <span class="pl-k">of</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">listen</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-kos">{</span>
  <span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</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">res</span> <span class="pl-k">of</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">serveHttp</span><span class="pl-kos">(</span><span class="pl-s1">conn</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-s1">res</span><span class="pl-kos">)</span><span class="pl-kos">;</span>                     <span class="pl-c">// &lt;------- Insert debug log.</span>
      <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-en">respondWith</span><span class="pl-kos">(</span><span class="pl-k">new</span> <span class="pl-smi">Response</span><span class="pl-kos">(</span><span class="pl-s1">body</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</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="error: Uncaught (in promise) TypeError: this.url is not a function
      console.log(res);
              ^
    at Request.[Deno.customInspect] (deno:op_crates/fetch/23_request.js:395:19)"><pre class="notranslate"><code class="notranslate">error: Uncaught (in promise) TypeError: this.url is not a function
      console.log(res);
              ^
    at Request.[Deno.customInspect] (deno:op_crates/fetch/23_request.js:395:19)
</code></pre></div>
<p dir="auto"><code class="notranslate">this.url()</code> but <code class="notranslate">this</code> has <code class="notranslate">url</code> getter. So, it should not call <code class="notranslate">url()</code>.<br>
<a href="https://github.com/denoland/deno/blob/v1.9.2/op_crates/fetch/23_request.js#L395">https://github.com/denoland/deno/blob/v1.9.2/op_crates/fetch/23_request.js#L395</a></p>
<p dir="auto">See example and link to source below.</p>
<p dir="auto"><code class="notranslate">example.ts</code>:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const r = new Request('https://example.com');
console.log(r);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">r</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Request</span><span class="pl-kos">(</span><span class="pl-s">'https://example.com'</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-s1">r</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 run example.ts
error: Uncaught TypeError: this.url is not a function
console.log(r);
        ^
    at Request.[Deno.customInspect] (deno:op_crates/fetch/23_request.js:395:19)
    at inspectObject (deno:op_crates/console/02_console.js:925:50)
    at inspectValue (deno:op_crates/console/02_console.js:481:16)
    at inspectArgs (deno:op_crates/console/02_console.js:1454:19)
    at console.log (deno:op_crates/console/02_console.js:1504:9)
    at file:///Users/jesse/example/example.ts:2:9

% deno --version
deno 1.9.2 (release, x86_64-apple-darwin)
v8 9.1.269.5
typescript 4.2.2"><pre class="notranslate"><code class="notranslate">% deno run example.ts
error: Uncaught TypeError: this.url is not a function
console.log(r);
        ^
    at Request.[Deno.customInspect] (deno:op_crates/fetch/23_request.js:395:19)
    at inspectObject (deno:op_crates/console/02_console.js:925:50)
    at inspectValue (deno:op_crates/console/02_console.js:481:16)
    at inspectArgs (deno:op_crates/console/02_console.js:1454:19)
    at console.log (deno:op_crates/console/02_console.js:1504:9)
    at file:///Users/jesse/example/example.ts:2:9

% deno --version
deno 1.9.2 (release, x86_64-apple-darwin)
v8 9.1.269.5
typescript 4.2.2
</code></pre></div>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/denoland/deno/blob/2400ecbe16775b54ccd9782119b09b00e3b0e786/op_crates/fetch/23_request.js#L389-L398">deno/op_crates/fetch/23_request.js</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 389 to 398
      in
      <a data-pjax="true" class="commit-tease-sha" href="/denoland/deno/commit/2400ecbe16775b54ccd9782119b09b00e3b0e786">2400ecb</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L389" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="389"></td>
          <td id="LC389" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">[</span><span class="pl-v">Symbol</span><span class="pl-kos">.</span><span class="pl-en">for</span><span class="pl-kos">(</span><span class="pl-s">"Deno.customInspect"</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">inspect</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L390" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="390"></td>
          <td id="LC390" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-k">const</span> <span class="pl-s1">inner</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L391" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="391"></td>
          <td id="LC391" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c1">bodyUsed</span>: <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">bodyUsed</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L392" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="392"></td>
          <td id="LC392" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c1">headers</span>: <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">headers</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L393" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="393"></td>
          <td id="LC393" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c1">method</span>: <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">method</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L394" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="394"></td>
          <td id="LC394" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c1">redirect</span>: <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">redirect</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L395" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="395"></td>
          <td id="LC395" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-c1">url</span>: <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">url</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L396" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="396"></td>
          <td id="LC396" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-kos">}</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L397" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="397"></td>
          <td id="LC397" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-k">return</span> <span class="pl-s">`Request <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">inspect</span><span class="pl-kos">(</span><span class="pl-s1">inner</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">;</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L398" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="398"></td>
          <td id="LC398" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-kos">}</span> </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>