<p dir="auto">The following should type check:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { default as postcssNesting } from &quot;npm:postcss-nesting@11.3.0&quot;;
postcssNesting();"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">default</span> <span class="pl-k">as</span> <span class="pl-s1">postcssNesting</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"npm:postcss-nesting@11.3.0"</span><span class="pl-kos">;</span>
<span class="pl-en">postcssNesting</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">but fails with the error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: TS2349 [ERROR]: This expression is not callable.
  Type 'typeof import(&quot;file:///home/martin/.cache/deno/npm/registry.npmjs.org/postcss-nesting/11.3.0/dist/index.d.ts&quot;)' has no call signatures.
postcssNesting();
~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">error: TS2349 [ERROR]: This expression is not callable.
  Type 'typeof import("file:///home/martin/.cache/deno/npm/registry.npmjs.org/postcss-nesting/11.3.0/dist/index.d.ts")' has no call signatures.
postcssNesting();
~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">Likewise the following should type check:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { default as Processor } from &quot;npm:windicss@3.5.6&quot;;
const processor = new Processor();"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">default</span> <span class="pl-k">as</span> <span class="pl-smi">Processor</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"npm:windicss@3.5.6"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">processor</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Processor</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">but fails with the error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: TS2351 [ERROR]: This expression is not constructable.
  Type 'typeof import(&quot;file:///home/martin/.cache/deno/npm/registry.npmjs.org/windicss/3.5.6/index.d.ts&quot;)' has no construct signatures.
const processor = new Processor();
                      ~~~~~~~~~"><pre class="notranslate"><code class="notranslate">error: TS2351 [ERROR]: This expression is not constructable.
  Type 'typeof import("file:///home/martin/.cache/deno/npm/registry.npmjs.org/windicss/3.5.6/index.d.ts")' has no construct signatures.
const processor = new Processor();
                      ~~~~~~~~~
</code></pre></div>
<p dir="auto">(using the latest deno 1.34.3)</p>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto"><code class="notranslate">npm:*</code> default exports are incorrectly typed. Packages that are exported as <code class="notranslate">default</code> are assumed to have a <code class="notranslate">default</code> property. The plugin will claim a type error when there are no actual runtime errors. Furthermore, trying to appease the plugin error by using the <code class="notranslate">default</code> property <em>will actually result</em> in runtime errors.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<ol dir="auto">
<li>Create a file <code class="notranslate">script.ts</code></li>
</ol>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import clsx from 'npm:clsx';

console.log(clsx(&quot;hello&quot;, &quot;goodbye&quot;));"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">clsx</span> <span class="pl-k">from</span> <span class="pl-s">'npm:clsx'</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-en">clsx</span><span class="pl-kos">(</span><span class="pl-s">"hello"</span><span class="pl-kos">,</span> <span class="pl-s">"goodbye"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="2" dir="auto">
<li>Cache dependencies, notice the following error:</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="This expression is not callable.
  Type 'typeof import(&quot;file:///Users/pting/Library/Caches/deno/npm/registry.npmjs.org/clsx/1.2.1/clsx&quot;)' has no call signatures.deno-ts(2349)"><pre class="notranslate"><code class="notranslate">This expression is not callable.
  Type 'typeof import("file:///Users/pting/Library/Caches/deno/npm/registry.npmjs.org/clsx/1.2.1/clsx")' has no call signatures.deno-ts(2349)
</code></pre></div>
<ol start="3" dir="auto">
<li>
<p dir="auto">Try running <code class="notranslate">deno run script.ts</code>, notice there are no errors at runtime</p>
</li>
<li>
<p dir="auto">Try appeasing the compiler:</p>
</li>
</ol>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="console.log(clsx.default(&quot;hello&quot;, &quot;goodbye&quot;));"><pre class="notranslate"><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">clsx</span><span class="pl-kos">.</span><span class="pl-en">default</span><span class="pl-kos">(</span><span class="pl-s">"hello"</span><span class="pl-kos">,</span> <span class="pl-s">"goodbye"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="5" dir="auto">
<li>Notice runtime error.</li>
</ol>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Expected plugin parsing behavior to match runtime behavior.</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/1680910/235057634-5abd9238-248f-460c-b2e4-2b76c7b805d9.png"><img width="353" alt="Screen Shot 2023-04-27 at 9 54 50 PM" src="https://user-images.githubusercontent.com/1680910/235057634-5abd9238-248f-460c-b2e4-2b76c7b805d9.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Versions</strong></p>
<p dir="auto">vscode: 1.77.3 deno: 1.33.0 extension: 3.17.0</p>