<p dir="auto">This is a strange bug.</p>
<p dir="auto">When loading both <code class="notranslate">https://deno.land/std@0.63.0/hash/mod.ts</code> and some cjs files, deno checks the type of cjs.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export { createHash } from &quot;https://deno.land/std@0.63.0/hash/mod.ts&quot;;
import {} from &quot;./cjsTest.cjs&quot;"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-kos">{</span> <span class="pl-s1">createHash</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/std@0.63.0/hash/mod.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"./cjsTest.cjs"</span></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: TS2339 [ERROR]: Property 'test' does not exist on type '{}'.
  return exports.test;
                 ~~~~
    at file:///C:/Users/stone/OneDrive/%EB%B0%94%ED%83%95%20%ED%99%94%EB%A9%B4/%EC%83%88%20%ED%8F%B4%EB%8D%94/postgres/cjsTest.cjs:4:18"><pre class="notranslate"><code class="notranslate">error: TS2339 [ERROR]: Property 'test' does not exist on type '{}'.
  return exports.test;
                 ~~~~
    at file:///C:/Users/stone/OneDrive/%EB%B0%94%ED%83%95%20%ED%99%94%EB%A9%B4/%EC%83%88%20%ED%8F%B4%EB%8D%94/postgres/cjsTest.cjs:4:18
</code></pre></div>
<p dir="auto">Windows 10 v2004 - X<br>
WSL (Ubuntu bionic) - X<br>
macOS Catalina - X</p>
<p dir="auto">Receiving TS2531 [ERROR] when running the mjs/cjs after Deno 1.0.4.</p>
<p dir="auto">save as "test.mjs"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { exp } from &quot;./test_mod.ts&quot;;
if (false) null.func();"><pre class="notranslate"><code class="notranslate">import { exp } from "./test_mod.ts";
if (false) null.func();
</code></pre></div>
<p dir="auto">save as "test_mod.ts"</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export const exp = {};"><pre class="notranslate"><code class="notranslate">export const exp = {};
</code></pre></div>
<p dir="auto">and run</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="% deno run test.mjs
Compile file:/// ... /test.mjs
error: TS2531 [ERROR]: Object is possibly 'null'.
if (false) null.func();
           ~~~~
    at file:/// ... /test.mjs:2:12"><pre class="notranslate"><code class="notranslate">% deno run test.mjs
Compile file:/// ... /test.mjs
error: TS2531 [ERROR]: Object is possibly 'null'.
if (false) null.func();
           ~~~~
    at file:/// ... /test.mjs:2:12
</code></pre></div>
<p dir="auto">1.0.5 -- NG<br>
1.0.4 -- NG<br>
1.0.3 -- OK</p>
<p dir="auto">without ts import -- OK<br>
import mjs -- OK</p>