<p dir="auto">I'm attempting to bundle a React app with <code class="notranslate">deno</code> and am running into a strange backtrace if I run it with an empty cache.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="alexmax@Alexs-iMac env.ts % uname -a
Darwin Alexs-iMac.local 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64
alexmax@Alexs-iMac env.ts % deno --version
deno 0.30.0
v8 8.1.108
typescript 3.7.2
alexmax@Alexs-iMac env.ts % RUST_BACKTRACE=1 deno bundle index.ts
Download https://dev.jspm.io/react
Download https://dev.jspm.io/react-dom
Download https://dev.jspm.io/npm:react@16.12.0/index.dew.js
Download https://dev.jspm.io/npm:react@16.12.0/cjs/react.development.dew.js
Download https://dev.jspm.io/npm:object-assign@4?dew
Download https://dev.jspm.io/npm:prop-types@15/checkPropTypes?dew
Download https://dev.jspm.io/npm:object-assign@4.1.1/index.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/checkPropTypes.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/lib/ReactPropTypesSecret.dew.js
Download https://dev.jspm.io/npm:react-dom@16.12.0/index.dew.js
Download https://dev.jspm.io/npm:react-dom@16.12.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew
Download https://dev.jspm.io/npm:scheduler@0.18?dew
Download https://dev.jspm.io/npm:scheduler@0.18/tracing?dew
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 17, kind: AlreadyExists, message: &quot;File exists&quot; }', src/libcore/result.rs:1165:5
stack backtrace:
   0: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  12: &lt;futures_util::future::try_join_all::TryJoinAll&lt;F&gt; as core::future::future::Future&gt;::poll
  13: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  14: futures_util::future::future::chain::Chain&lt;Fut1,Fut2,Data&gt;::poll
  15: &lt;futures_util::future::future::then::Then&lt;Fut1,Fut2,F&gt; as core::future::future::Future&gt;::poll
  16: &lt;futures_util::future::try_future::map_ok::MapOk&lt;Fut,F&gt; as core::future::future::Future&gt;::poll
  17: &lt;futures_util::future::try_future::map_ok::MapOk&lt;Fut,F&gt; as core::future::future::Future&gt;::poll
  18: futures_util::stream::stream::StreamExt::poll_next_unpin
  19: &lt;deno_core::isolate::Isolate as core::future::future::Future&gt;::poll
  20: &lt;deno_core::es_isolate::EsIsolate as core::future::future::Future&gt;::poll
  21: &lt;deno::worker::Worker as core::future::future::Future&gt;::poll
  22: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  23: tokio::runtime::enter::Enter::block_on
  24: tokio::runtime::context::enter
  25: deno::tokio_util::run
  26: deno::main
  27: std::rt::lang_start::{{closure}}
  28: std::panicking::try::do_call
  29: __rust_maybe_catch_panic
  30: std::rt::lang_start_internal
  31: main"><pre class="notranslate"><code class="notranslate">alexmax@Alexs-iMac env.ts % uname -a
Darwin Alexs-iMac.local 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec  1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64
alexmax@Alexs-iMac env.ts % deno --version
deno 0.30.0
v8 8.1.108
typescript 3.7.2
alexmax@Alexs-iMac env.ts % RUST_BACKTRACE=1 deno bundle index.ts
Download https://dev.jspm.io/react
Download https://dev.jspm.io/react-dom
Download https://dev.jspm.io/npm:react@16.12.0/index.dew.js
Download https://dev.jspm.io/npm:react@16.12.0/cjs/react.development.dew.js
Download https://dev.jspm.io/npm:object-assign@4?dew
Download https://dev.jspm.io/npm:prop-types@15/checkPropTypes?dew
Download https://dev.jspm.io/npm:object-assign@4.1.1/index.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/checkPropTypes.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/lib/ReactPropTypesSecret.dew.js
Download https://dev.jspm.io/npm:react-dom@16.12.0/index.dew.js
Download https://dev.jspm.io/npm:react-dom@16.12.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew
Download https://dev.jspm.io/npm:scheduler@0.18?dew
Download https://dev.jspm.io/npm:scheduler@0.18/tracing?dew
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 17, kind: AlreadyExists, message: "File exists" }', src/libcore/result.rs:1165:5
stack backtrace:
   0: &lt;std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display&gt;::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::continue_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::result::unwrap_failed
  10: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  11: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  12: &lt;futures_util::future::try_join_all::TryJoinAll&lt;F&gt; as core::future::future::Future&gt;::poll
  13: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  14: futures_util::future::future::chain::Chain&lt;Fut1,Fut2,Data&gt;::poll
  15: &lt;futures_util::future::future::then::Then&lt;Fut1,Fut2,F&gt; as core::future::future::Future&gt;::poll
  16: &lt;futures_util::future::try_future::map_ok::MapOk&lt;Fut,F&gt; as core::future::future::Future&gt;::poll
  17: &lt;futures_util::future::try_future::map_ok::MapOk&lt;Fut,F&gt; as core::future::future::Future&gt;::poll
  18: futures_util::stream::stream::StreamExt::poll_next_unpin
  19: &lt;deno_core::isolate::Isolate as core::future::future::Future&gt;::poll
  20: &lt;deno_core::es_isolate::EsIsolate as core::future::future::Future&gt;::poll
  21: &lt;deno::worker::Worker as core::future::future::Future&gt;::poll
  22: &lt;std::future::GenFuture&lt;T&gt; as core::future::future::Future&gt;::poll
  23: tokio::runtime::enter::Enter::block_on
  24: tokio::runtime::context::enter
  25: deno::tokio_util::run
  26: deno::main
  27: std::rt::lang_start::{{closure}}
  28: std::panicking::try::do_call
  29: __rust_maybe_catch_panic
  30: std::rt::lang_start_internal
  31: main
</code></pre></div>
<p dir="auto">If I then run the command again immediately, I don't get a Rust exception, but I get a normal pretty exception.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="alexmax@Alexs-iMac env.ts % RUST_BACKTRACE=1 deno bundle index.ts
Download https://dev.jspm.io/npm:react-dom@16.12.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew

error: Uncaught Other: Not a directory (os error 20)
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendAsync ($deno$/dispatch_json.ts:91:10)"><pre class="notranslate"><code class="notranslate">alexmax@Alexs-iMac env.ts % RUST_BACKTRACE=1 deno bundle index.ts
Download https://dev.jspm.io/npm:react-dom@16.12.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew

error: Uncaught Other: Not a directory (os error 20)
► $deno$/dispatch_json.ts:40:11
    at DenoError ($deno$/errors.ts:20:5)
    at unwrapResponse ($deno$/dispatch_json.ts:40:11)
    at sendAsync ($deno$/dispatch_json.ts:91:10)
</code></pre></div>
<p dir="auto">Unfortunately, neither exception appears to give me any details as to what file path it's having issues with, or why it's having an issue with the file path in the first place.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="deno fetch https://dev.jspm.io/react-dom
Download https://dev.jspm.io/react-dom
Download https://dev.jspm.io/npm:react-dom@16.9.0/index.dew.js
Download https://dev.jspm.io/npm:react-dom@16.9.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew
Download https://dev.jspm.io/npm:object-assign@4?dew
Download https://dev.jspm.io/npm:prop-types@15/checkPropTypes?dew
Download https://dev.jspm.io/npm:scheduler@0.15?dew
Download https://dev.jspm.io/npm:scheduler@0.15/tracing?dew
Download https://dev.jspm.io/npm:object-assign@4.1.1/index.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/checkPropTypes.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/lib/ReactPropTypesSecret.dew.js
Download https://dev.jspm.io/npm:scheduler@0.15.0/tracing.dew.js
Download https://dev.jspm.io/npm:scheduler@0.15.0/cjs/scheduler-tracing.development.dew.js
thread 'tokio-runtime-worker-6' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 21, kind: Other, message: &quot;Is a directory&quot; }', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'main' panicked at 'internal error: entered unreachable code', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/mod.rs:296:26
thread 'tokio-runtime-worker-0' panicked at 'unexpected state while aborting task: Complete', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.15/src/task/mod.rs:216:21"><pre class="notranslate"><code class="notranslate">deno fetch https://dev.jspm.io/react-dom
Download https://dev.jspm.io/react-dom
Download https://dev.jspm.io/npm:react-dom@16.9.0/index.dew.js
Download https://dev.jspm.io/npm:react-dom@16.9.0/cjs/react-dom.development.dew.js
Download https://dev.jspm.io/npm:react@16?dew
Download https://dev.jspm.io/npm:object-assign@4?dew
Download https://dev.jspm.io/npm:prop-types@15/checkPropTypes?dew
Download https://dev.jspm.io/npm:scheduler@0.15?dew
Download https://dev.jspm.io/npm:scheduler@0.15/tracing?dew
Download https://dev.jspm.io/npm:object-assign@4.1.1/index.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/checkPropTypes.dew.js
Download https://dev.jspm.io/npm:prop-types@15.7.2/lib/ReactPropTypesSecret.dew.js
Download https://dev.jspm.io/npm:scheduler@0.15.0/tracing.dew.js
Download https://dev.jspm.io/npm:scheduler@0.15.0/cjs/scheduler-tracing.development.dew.js
thread 'tokio-runtime-worker-6' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 21, kind: Other, message: "Is a directory" }', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'main' panicked at 'internal error: entered unreachable code', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/mod.rs:296:26
thread 'tokio-runtime-worker-0' panicked at 'unexpected state while aborting task: Complete', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.15/src/task/mod.rs:216:21
</code></pre></div>
<p dir="auto">I don't know precisely what is going on, but something goes wrong..</p>
<p dir="auto">Content of <code class="notranslate">~/Library/Caches/deno/deps/https/dev.jspm.io/npm:scheduler@0.15.headers.json</code> is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{&quot;mime_type&quot;:&quot;application/javascript&quot;}"><pre class="notranslate"><code class="notranslate">{"mime_type":"application/javascript"}
</code></pre></div>
<p dir="auto">but <code class="notranslate">~/Library/Caches/deno/deps/https/dev.jspm.io/npm:scheduler@0.15</code> is DIRECTORY</p>
<p dir="auto">This may occur when there are two url modules like these:</p>
<ul dir="auto">
<li><a href="https://dev.jspm.io/npm:scheduler@0.15" rel="nofollow">https://dev.jspm.io/npm:scheduler@0.15</a> &lt;- application/javascript</li>
<li><a href="https://dev.jspm.io/npm:scheduler@0.15/tracing" rel="nofollow">https://dev.jspm.io/npm:scheduler@0.15/tracing</a> &lt;-application/javascript</li>
</ul>