<ul dir="auto">
<li>Deno: v0.35.0</li>
</ul>
<p dir="auto"><code class="notranslate">.d.ts</code> file can't be compiled when it is  executed from CLI.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno empty.d.ts
Compile file:///Users/keroxp/src/deno/empty.d.ts
No such file or directory (os error 2)"><pre class="notranslate"><code class="notranslate">$ deno empty.d.ts
Compile file:///Users/keroxp/src/deno/empty.d.ts
No such file or directory (os error 2)
</code></pre></div>
<p dir="auto">Import without declaration cause same error.</p>
<p dir="auto"><strong>some.ts</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import &quot;./empty.d.ts&quot;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">"./empty.d.ts"</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ deno some.ts
Compile file:///Users/keroxp/src/deno/some.ts
Compile file:///Users/keroxp/src/deno/empty.d.ts
No such file or directory (os error 2)"><pre class="notranslate"><code class="notranslate">$ deno some.ts
Compile file:///Users/keroxp/src/deno/some.ts
Compile file:///Users/keroxp/src/deno/empty.d.ts
No such file or directory (os error 2)
</code></pre></div>
<p dir="auto">With declaration, no error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as empty from &quot;./empty.d.ts&quot;"><pre class="notranslate"><code class="notranslate">import * as empty from "./empty.d.ts"
</code></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="❯❯❯ cat types.d.ts 
export interface HelloWorld {}
❯❯❯ cat mod.ts 
export * from &quot;./types.d.ts&quot;;
❯❯❯ deno info mod.ts
error: Failed to get compiled source code of file:///mnt/f9/Projects/github.com/denoland/deno_registry2/types.d.ts.
Reason: No such file or directory (os error 2)"><pre class="notranslate">❯❯❯ cat types.d.ts 
<span class="pl-k">export</span> interface HelloWorld {}
❯❯❯ cat mod.ts 
<span class="pl-k">export</span> <span class="pl-k">*</span> from <span class="pl-s"><span class="pl-pds">"</span>./types.d.ts<span class="pl-pds">"</span></span><span class="pl-k">;</span>
❯❯❯ deno info mod.ts
error: Failed to get compiled <span class="pl-c1">source</span> code of file:///mnt/f9/Projects/github.com/denoland/deno_registry2/types.d.ts.
Reason: No such file or directory (os error 2)</pre></div>
<p dir="auto">Try it out locally: <code class="notranslate">$ deno cache https://git.io/JJsqz</code></p>
<p dir="auto">The quick hacky fix is to forcefully emit an empty file when when tsc skips emitting the file. We know which files we are expecting to be emitted because they should map 1:1 to the input (source) files.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bartlomieju/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bartlomieju">@bartlomieju</a></p>