<p dir="auto">There are a couple of bugs here:</p>
<ol dir="auto">
<li><code class="notranslate">deno install -A ...</code> should not expand in the wrapper. If Deno introduces more permissions, wrappers may end up diverging.</li>
<li><code class="notranslate">deno install -A ...</code> creates duplicate <code class="notranslate">--allow-env</code> flags. Fixing (1) will make this not an issue.</li>
</ol>
<p dir="auto">Also, looking at the shell wrapper it would be preferrable to call <code class="notranslate">exec</code> rather than saving the return code and exiting manually.</p>
<p dir="auto">Hi,</p>
<p dir="auto">Following code of mine caused panic, was instructed to report here. More accuratelly when fetching return value from haeMPYhteenveto function.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const haeMPYhteenveto = () =&gt; {
    const mpSumma = itemServices.haeSumma();
    console.log(mpSumma);
    return mpSumma;
};

const haeOstokset = async ({ response }) =&gt; {
    const mpSumma = haeMPYhteenveto();
    response.body = await renderFile('../views/kulut.eta', {
        kustannukset: await itemServices.haeHankinnat(),
        mpsumma: mpSumma,
    });
};"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">haeMPYhteenveto</span> <span class="pl-c1">=</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">const</span> <span class="pl-s1">mpSumma</span> <span class="pl-c1">=</span> <span class="pl-s1">itemServices</span><span class="pl-kos">.</span><span class="pl-en">haeSumma</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">mpSumma</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-s1">mpSumma</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-en">haeOstokset</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> response <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">const</span> <span class="pl-s1">mpSumma</span> <span class="pl-c1">=</span> <span class="pl-en">haeMPYhteenveto</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">response</span><span class="pl-kos">.</span><span class="pl-c1">body</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">renderFile</span><span class="pl-kos">(</span><span class="pl-s">'../views/kulut.eta'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
        <span class="pl-c1">kustannukset</span>: <span class="pl-k">await</span> <span class="pl-s1">itemServices</span><span class="pl-kos">.</span><span class="pl-en">haeHankinnat</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
        <span class="pl-c1">mpsumma</span>: <span class="pl-s1">mpSumma</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>
<p dir="auto"><strong>Error note:</strong></p>
<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: windows x86_64
Version: 1.18.1
Args: [&quot;C:\\Users\\Admin\\.deno\\bin\\deno.exe&quot;, &quot;run&quot;, &quot;--allow-net&quot;, &quot;--unstable&quot;, &quot;--allow-read&quot;, &quot;--allow-write&quot;, &quot;app.js&quot;]

thread 'main' panicked at 'Only a single use of this resource should happen: FullDuplexResource { rd: AsyncRefCell&lt;tokio::net::tcp::split_owned::OwnedReadHalf&gt;, wr: AsyncRefCell&lt;tokio::net::tcp::split_owned::OwnedWriteHalf&gt;, cancel_handle: CancelHandle { node: Node { inner: UnsafeCell { .. }, _pin: PhantomPinned } } }', D:\a\deno\deno\ext\net\ops_tls.rs:812:6
note: run with `RUST_BACKTRACE=1` environment variable to display a 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: windows x86_64
Version: 1.18.1
Args: ["C:\\Users\\Admin\\.deno\\bin\\deno.exe", "run", "--allow-net", "--unstable", "--allow-read", "--allow-write", "app.js"]

thread 'main' panicked at 'Only a single use of this resource should happen: FullDuplexResource { rd: AsyncRefCell&lt;tokio::net::tcp::split_owned::OwnedReadHalf&gt;, wr: AsyncRefCell&lt;tokio::net::tcp::split_owned::OwnedWriteHalf&gt;, cancel_handle: CancelHandle { node: Node { inner: UnsafeCell { .. }, _pin: PhantomPinned } } }', D:\a\deno\deno\ext\net\ops_tls.rs:812:6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
</code></pre></div>