<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~ $ deno
Deno 1.8.2
exit using ctrl+d or close()
&gt; import { emptyDir } from &quot;https://deno.land/std@0.91.0/fs/mod.ts&quot;;
Uncaught SyntaxError: Cannot use import statement outside a module"><pre class="notranslate"><code class="notranslate">~ $ deno
Deno 1.8.2
exit using ctrl+d or close()
&gt; import { emptyDir } from "https://deno.land/std@0.91.0/fs/mod.ts";
Uncaught SyntaxError: Cannot use import statement outside a module
</code></pre></div>
<p dir="auto">seems like import should probably work on cli without having to do something like this (which also didn't ultimately work)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; let emptyDir; import(&quot;https://deno.land/std@0.91.0/fs/mod.ts&quot;).then(m =&gt; ({emtpyDir} = m))
Check https://deno.land/std@0.91.0/fs/mod.ts
Promise {
  &lt;rejected&gt; TypeError: TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:96:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:111:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:135:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:160:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:183:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:214:10

Found 6 errors.
}
&gt; "><pre class="notranslate"><code class="notranslate">&gt; let emptyDir; import("https://deno.land/std@0.91.0/fs/mod.ts").then(m =&gt; ({emtpyDir} = m))
Check https://deno.land/std@0.91.0/fs/mod.ts
Promise {
  &lt;rejected&gt; TypeError: TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:96:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:111:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, statInfo.atime, statInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:135:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:160:10

TS2339 [ERROR]: Property 'utime' does not exist on type 'typeof Deno'. 'Deno.utime' is an unstable API. Did you forget to run with the '--unstable' flag?
    await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
               ~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:183:16

TS2339 [ERROR]: Property 'utimeSync' does not exist on type 'typeof Deno'. 'Deno.utimeSync' is an unstable API. Did you forget to run with the '--unstable' flag?
    Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
         ~~~~~~~~~
    at https://deno.land/std@0.91.0/fs/copy.ts:214:10

Found 6 errors.
}
&gt; 
</code></pre></div>
<p dir="auto">Hi there! I've ran into this error when running the ✨ new ✨ HTTP server via <code class="notranslate">Deno.serve</code>.<br>
The error does not occur when importing <code class="notranslate">serve</code> from <code class="notranslate">/std/http/mod.ts</code> regularly.</p>
<p dir="auto"><strong>Error</strong>:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Watcher File change detected! Restarting!

============================================================
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: linux x86_64
Version: 1.25.0
Args: [&quot;deno&quot;, &quot;run&quot;, &quot;--unstable&quot;, &quot;--allow-net&quot;, &quot;--watch&quot;, &quot;repro.tsx&quot;]

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', ext/flash/lib.rs:1316:42
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:48:5
   3: &lt;core::future::from_generator::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
   4: &lt;extern &quot;C&quot; fn(A0) .&gt; R as v8::support::CFnFrom&lt;F&gt;&gt;::mapping::c_fn
   5: _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
             at ./../../../../v8/src/builtins/builtins-api.cc:112:36
   6: _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
             at ./../../../../v8/src/builtins/builtins-api.cc:130:1
   7: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit"><pre class="notranslate">Watcher File change detected<span class="pl-k">!</span> Restarting<span class="pl-k">!</span>

============================================================
Deno has panicked. This is a bug <span class="pl-k">in</span> 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 <span class="pl-c1">set</span> and include the backtrace <span class="pl-k">in</span> your report.

Platform: linux x86_64
Version: 1.25.0
Args: [<span class="pl-s"><span class="pl-pds">"</span>deno<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>run<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>--unstable<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>--allow-net<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>--watch<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>repro.tsx<span class="pl-pds">"</span></span>]

thread <span class="pl-s"><span class="pl-pds">'</span>main<span class="pl-pds">'</span></span> panicked at <span class="pl-s"><span class="pl-pds">'</span>called `Option::unwrap()` on a `None` value<span class="pl-pds">'</span></span>, ext/flash/lib.rs:1316:42
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:48:5
   3: <span class="pl-k">&lt;</span>core::future::from_generator::GenFuture<span class="pl-k">&lt;</span>T<span class="pl-k">&gt;</span> as core::future::future::Future<span class="pl-k">&gt;</span>::poll
   4: <span class="pl-k">&lt;</span>extern <span class="pl-s"><span class="pl-pds">"</span>C<span class="pl-pds">"</span></span> fn(A0) .<span class="pl-k">&gt;</span> R as v8::support::CFnFrom<span class="pl-k">&lt;</span>F<span class="pl-k">&gt;&gt;</span>::mapping::c_fn
   5: _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
             at ./../../../../v8/src/builtins/builtins-api.cc:112:36
   6: _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
             at ./../../../../v8/src/builtins/builtins-api.cc:130:1
   7: Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit</pre></div>
<p dir="auto"><strong>Steps for reproduction</strong>:</p>
<ol dir="auto">
<li>Create a <code class="notranslate">tsx</code> file with the contents:</li>
</ol>
<div class="highlight highlight-source-tsx notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/** @jsx h */
import { h, ssr } from &quot;https://crux.land/nanossr@0.0.1&quot;;
Deno.serve(() =&gt; ssr(() =&gt; &lt;p&gt;Hello world.&lt;/p&gt;));"><pre class="notranslate"><span class="pl-c">/** <span class="pl-k">@jsx</span> h */</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">h</span><span class="pl-kos">,</span> <span class="pl-s1">ssr</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://crux.land/nanossr@0.0.1"</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">serve</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-en">ssr</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-c1">&lt;</span><span class="pl-ent">p</span><span class="pl-c1">&gt;</span>Hello world.<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">p</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="2" dir="auto">
<li>Run the file with <code class="notranslate">RUST_BACKTRATE=1 deno run --unstable --allow-net --watch repro.tsx</code>.</li>
<li>Update (save) the file to trigger a file change.</li>
<li>Observe</li>
</ol>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/littledivy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/littledivy">@littledivy</a></p>