<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.32.3</li>
<li>Operating System: macOS 13.3.1</li>
<li>Browser: N/A</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto"><a href="https://github.com/OliverJAsh/playwright-ts-paths-issues/tree/base-url-ignored">https://github.com/OliverJAsh/playwright-ts-paths-issues/tree/base-url-ignored</a></p>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as Foo from &quot;Foo&quot;;
console.log(Foo);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-v">Foo</span> <span class="pl-k">from</span> <span class="pl-s">"Foo"</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-v">Foo</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><code class="notranslate">tsconfig.json</code>:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    &quot;baseUrl&quot;: &quot;.&quot;,
    &quot;paths&quot;: {
      &quot;shared/*&quot;: [&quot;./shared/*&quot;]
    }"><pre class="notranslate">    <span class="pl-ent">"baseUrl"</span>: <span class="pl-s"><span class="pl-pds">"</span>.<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"paths"</span>: {
      <span class="pl-ent">"shared/*"</span>: [<span class="pl-s"><span class="pl-pds">"</span>./shared/*<span class="pl-pds">"</span></span>]
    }</pre></div>
<p dir="auto"><strong>Steps</strong></p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ yarn
$ rm -rf .cache &amp;&amp; tsc
$ rm -rf .cache &amp;&amp; playwright test"><pre class="notranslate">$ <span class="pl-s1">yarn</span>
$ <span class="pl-s1">rm -rf .cache <span class="pl-k">&amp;&amp;</span> tsc</span>
$ <span class="pl-s1">rm -rf .cache <span class="pl-k">&amp;&amp;</span> playwright <span class="pl-c1">test</span></span></pre></div>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto"><code class="notranslate">playwright test</code> should resolve all modules correctly, as per the behaviour of <code class="notranslate">tsc</code>.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto"><code class="notranslate">playwright test</code> results in the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: Cannot find module 'Foo'
Require stack:
- /Users/oliverash/Development/playwright-ts-paths-issues/tests/example.spec.ts"><pre class="notranslate"><code class="notranslate">Error: Cannot find module 'Foo'
Require stack:
- /Users/oliverash/Development/playwright-ts-paths-issues/tests/example.spec.ts
</code></pre></div>
<p dir="auto"><strong>Workaround</strong></p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="diff --git a/tsconfig.json b/tsconfig.json
index 0eaedd8..89c2a6f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,6 +5,7 @@
     &quot;rootDir&quot;: &quot;.&quot;,
     &quot;baseUrl&quot;: &quot;.&quot;,
     &quot;paths&quot;: {
+      &quot;*&quot;: [&quot;./*&quot;],
       &quot;shared/*&quot;: [&quot;./shared/*&quot;]
     }
   },
"><pre class="notranslate"><span class="pl-c1">diff --git a/tsconfig.json b/tsconfig.json</span>
index 0eaedd8..89c2a6f 100644
<span class="pl-md">--- a/tsconfig.json</span>
<span class="pl-mi1">+++ b/tsconfig.json</span>
<span class="pl-mdr">@@ -5,6 +5,7 @@</span>
     "rootDir": ".",
     "baseUrl": ".",
     "paths": {
<span class="pl-mi1"><span class="pl-mi1">+</span>      "*": ["./*"],</span>
       "shared/*": ["./shared/*"]
     }
   },
</pre></div>
<p dir="auto">This shouldn't be necessary because Playwright should use the <code class="notranslate">baseUrl</code> to resolve the import specifier.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: "@playwright/experimental-ct-react": "^1.35.1"</li>
<li>Operating System: Windows 11</li>
<li>Browser: All</li>
<li>Other info: Yarn v3.6 with PnP, Node v20.3.0</li>
</ul>
<p dir="auto">I followed <a href="https://playwright.dev/docs/test-components#how-to-get-started" rel="nofollow">https://playwright.dev/docs/test-components#how-to-get-started</a> in order to add Playwright Component Testing support to my project. While all of the initialization steps seemed to succeed, running the test command fails.</p>
<h3 dir="auto">Source code</h3>




<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Unzip provided source code</li>
<li>Run <code class="notranslate">yarn</code></li>
<li>Run <code class="notranslate">yarn test:components</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Playwright test suite runs and denotes that the App.spec test failed as it's looking for different text than what's being rendered within App</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Playwright test suite fails to start with the following error:<br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/86689712/247306904-2f9e95a2-ee66-45bb-a9d5-cb318c292223.png"><img src="https://user-images.githubusercontent.com/86689712/247306904-2f9e95a2-ee66-45bb-a9d5-cb318c292223.png" alt="image" style="max-width: 100%;"></a></p>