title: TypeScript + Playwright Error: Cannot find module
body: <p>I ran into a problem coding test automation with playwright.
  When running the test,
  the following error occurs at test.spec.ts:</p>
  <p><strong>Error: Cannot find module '@common/common'</strong>
  <strong>code: 'MODULE_NOT_FOUND'</strong></p>
  <p>How to solve this problem?</p>
  <p>there are codes below</p>
  <p><strong>test.spec.ts</strong></p>
  <pre><code>import { chromium, ChromiumBrowser, Page } from &quot;playwright&quot;;
  import { test, expect, PlaywrightTestConfig } from &quot;@playwright/test&quot;;
  import Common from &quot;@common/common&quot;;
  
  test.beforeAll(async ({ page }) =&gt; {
  
  });
  
  test.describe('Go test', () =&gt; {
    test('Test1', async ({ page }) =&gt; {
      console.log(&quot;1111111111&quot;);
    });
  })
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre><code>{
    &quot;name&quot;: &quot;type-sanity&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;ts-node -r tsconfig-paths/register src/main.ts&quot;,
      &quot;test&quot;: &quot;npx playwright test&quot;
    },
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;dependencies&quot;: {
      &quot;@types/randomstring&quot;: &quot;^1.1.7&quot;,
      &quot;playwright&quot;: &quot;^1.14.0&quot;,
      &quot;randomstring&quot;: &quot;^1.2.1&quot;,
      &quot;typescript&quot;: &quot;^4.3.5&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@playwright/test&quot;: &quot;^1.14.0&quot;,
      &quot;@types/node&quot;: &quot;latest&quot;,
      &quot;ts-node&quot;: &quot;^10.1.0&quot;,
      &quot;tsconfig-paths&quot;: &quot;^3.10.1&quot;,
      &quot;typescript-module-alias&quot;: &quot;^1.0.2&quot;
    }
  }
  
  </code></pre>
  <p><strong>tsconfig.json</strong></p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;target&quot;: &quot;ES5&quot;,
      &quot;module&quot;: &quot;commonjs&quot;,
      &quot;strict&quot;: true,
      &quot;esModuleInterop&quot;: true,
      &quot;resolveJsonModule&quot;: true,
      &quot;outDir&quot;: &quot;./dist&quot;,
      &quot;baseUrl&quot;: &quot;.&quot;,
      &quot;types&quot;: [],
      &quot;paths&quot;: {
        &quot;@config/*&quot;: [
          &quot;tests/config/*&quot;
        ],
        &quot;@common/*&quot;: [
          &quot;src/common/*&quot;
        ],
      }
    },
    &quot;exclude&quot;: [
      &quot;node_modules&quot;
    ]
  }
  </code></pre>