<p dir="auto">Getting an error when trying to use <code class="notranslate">DatagramConn</code> to send to the network's broadcast address.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const msg = new TextEncoder().encode(&quot;Hello world\n&quot;);

const conn = Deno.listenDatagram({
  hostname: &quot;0.0.0.0&quot;,
  port: 8002,
  transport: &quot;udp&quot;,
});

await conn.send(msg, {
  hostname: &quot;192.168.1.255&quot;,
  port: 8001,
  transport: &quot;udp&quot;,
});"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">msg</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\n"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">conn</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">listenDatagram</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">hostname</span>: <span class="pl-s">"0.0.0.0"</span><span class="pl-kos">,</span>
  <span class="pl-c1">port</span>: <span class="pl-c1">8002</span><span class="pl-kos">,</span>
  <span class="pl-c1">transport</span>: <span class="pl-s">"udp"</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">await</span> <span class="pl-s1">conn</span><span class="pl-kos">.</span><span class="pl-en">send</span><span class="pl-kos">(</span><span class="pl-s1">msg</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">hostname</span>: <span class="pl-s">"192.168.1.255"</span><span class="pl-kos">,</span>
  <span class="pl-c1">port</span>: <span class="pl-c1">8001</span><span class="pl-kos">,</span>
  <span class="pl-c1">transport</span>: <span class="pl-s">"udp"</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">Running the above with:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno run --allow-net --unstable test.ts"><pre class="notranslate">deno run --allow-net --unstable test.ts</pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: Uncaught (in promise) PermissionDenied: Permission denied (os error 13)
await conn.send(msg, {
^
    at unwrapOpResult (deno:core/core.js:102:13)
    at async file:///home/pi/test.ts:9:1"><pre class="notranslate"><code class="notranslate">error: Uncaught (in promise) PermissionDenied: Permission denied (os error 13)
await conn.send(msg, {
^
    at unwrapOpResult (deno:core/core.js:102:13)
    at async file:///home/pi/test.ts:9:1
</code></pre></div>
<p dir="auto">When using <code class="notranslate">Deno.memoryUsage()</code> without the <code class="notranslate">--unstable</code> flag, Deno causes the following error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: TS2339 [ERROR]: Property 'memoryUsage' does not exist on type 'typeof Deno'.
console.log(Deno.memoryUsage());
                 ~~~~~~~~~~~"><pre class="notranslate">error: TS2339 [ERROR]: Property <span class="pl-s"><span class="pl-pds">'</span>memoryUsage<span class="pl-pds">'</span></span> does not exist on <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>typeof Deno<span class="pl-pds">'</span></span>.
<span class="pl-en">console.log(Deno.memoryUsage</span>());
                 <span class="pl-k">~</span>~~~~~~~~~~</pre></div>
<p dir="auto">On the other hand, other unstable APIs (e.g. <code class="notranslate">Deno.resolveDns()</code>) cause the following error:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="error: TS2339 [ERROR]: Property 'resolveDns' does not exist on type 'typeof Deno'. 'Deno.resolveDns' is an unstable API. Did you forget to run with the '--unstable' flag?
console.log(Deno.resolveDns());"><pre class="notranslate">error: TS2339 [ERROR]: Property <span class="pl-s"><span class="pl-pds">'</span>resolveDns<span class="pl-pds">'</span></span> does not exist on <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>typeof Deno<span class="pl-pds">'</span></span>. <span class="pl-s"><span class="pl-pds">'</span>Deno.resolveDns<span class="pl-pds">'</span></span> is an unstable API. Did you forget to run with the <span class="pl-s"><span class="pl-pds">'</span>--unstable<span class="pl-pds">'</span></span> flag<span class="pl-k">?</span>
<span class="pl-en">console.log(Deno.resolveDns</span>());</pre></div>
<p dir="auto">It seems that <code class="notranslate">"memoryUsage"</code> is not listed in <a href="https://github.com/denoland/deno/blob/v1.9.2/cli/diagnostics.rs#L15">UNSTABLE_DENO_PROPS</a> 🙂</p>