<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.29.2]</li>
<li>Operating System: [macOS 13.2, macOS 11.5.2] ※but, I didn't check other versions.</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul dir="auto">
<li>[] I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'], },
    },
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos"></span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<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 { expect, test } from '@playwright/test';

test('testTitle', async ({ page }) =&gt; {
  await page.goto('url');
  await expect(page).toHaveTitle(/pageTitle/);
  await page.evaluate(() =&gt; window.scroll({ top: 0 }));
  await expect(page).toHaveScreenshot(); // problem occurred
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">expect</span><span class="pl-kos">,</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'testTitle'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'url'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>pageTitle<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">evaluate</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-en">scroll</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">top</span>: <span class="pl-c1">0</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveScreenshot</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// problem occurred</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run the test</li>
<li>and then error occurred</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: Screenshot comparison failed:
      6 pixels (ratio 0.01 of all image pixels) are different."><pre class="notranslate"><code class="notranslate">Error: Screenshot comparison failed:
      6 pixels (ratio 0.01 of all image pixels) are different.
</code></pre></div>
<p dir="auto"><strong>Expected</strong><br>
The test should be succeeded no matter who does it.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">The following errors may or may not occur when the same test is performed by different engineers.<br>
There are people who succeed even if the version of mac Os is different, but the error in the attached screenshot occurs</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65144660/223423139-7966b242-8539-42ae-9a5f-fee9d5b788e4.png"><img src="https://user-images.githubusercontent.com/65144660/223423139-7966b242-8539-42ae-9a5f-fee9d5b788e4.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65144660/223422977-64dee4ca-6bf8-4421-8f13-dc034afcaf5d.png"><img src="https://user-images.githubusercontent.com/65144660/223422977-64dee4ca-6bf8-4421-8f13-dc034afcaf5d.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/65144660/223425568-b59c4b87-2705-49a9-94c1-57e2f5c927d2.png"><img src="https://user-images.githubusercontent.com/65144660/223425568-b59c4b87-2705-49a9-94c1-57e2f5c927d2.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.32.1</li>
<li>Operating System: Windows 11</li>
<li>Browser: All</li>
<li>Other info: We leverage "Webpack" normally to package our test files but we are able to remove all of the "Webpackifying" except for the source map comment to repro this issue</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">Create two test files in the same directory:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// bad.playwright.ui.test.js
throw new Error(&quot;ERROR&quot;);
//# sourceMappingURL=bad.playwright.ui.test.js.map"><pre class="notranslate"><span class="pl-c">// bad.playwright.ui.test.js</span>
<span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">"ERROR"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//# sourceMappingURL=bad.playwright.ui.test.js.map</span></pre></div>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// good.playwright.ui.test.js
import { test, expect } from &quot;@playwright/test&quot;;

test(&quot;has title&quot;, async ({ page }) =&gt; {
  await page.goto(&quot;https://playwright.dev/&quot;);
  await expect(page).toHaveTitle(/Playwright/);
});"><pre class="notranslate"><span class="pl-c">// good.playwright.ui.test.js</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"has title"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">"https://playwright.dev/"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-pds"><span class="pl-c1">/</span>Playwright<span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">//package.json</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;repro&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;repro&quot;,
  &quot;main&quot;: &quot;index.ts&quot;,
  &quot;module&quot;: &quot;index.ts&quot;,
  &quot;private&quot;: true,
  &quot;sideEffects&quot;: false,
  &quot;license&quot;: &quot;UNLICENSED&quot;,
  &quot;dependencies&quot;: {
    &quot;@playwright/test&quot;: &quot;1.32.1&quot;,
    &quot;playwright&quot;: &quot;1.32.1&quot;
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"name"</span>: <span class="pl-s"><span class="pl-pds">"</span>repro<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.0<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"description"</span>: <span class="pl-s"><span class="pl-pds">"</span>repro<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"main"</span>: <span class="pl-s"><span class="pl-pds">"</span>index.ts<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"module"</span>: <span class="pl-s"><span class="pl-pds">"</span>index.ts<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"private"</span>: <span class="pl-c1">true</span>,
  <span class="pl-ent">"sideEffects"</span>: <span class="pl-c1">false</span>,
  <span class="pl-ent">"license"</span>: <span class="pl-s"><span class="pl-pds">"</span>UNLICENSED<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"dependencies"</span>: {
    <span class="pl-ent">"@playwright/test"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.32.1<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"playwright"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.32.1<span class="pl-pds">"</span></span>
  }
}</pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li><code class="notranslate">yarn install</code></li>
<li><code class="notranslate">yarn playwright test good.playwright.ui.test</code></li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">I expect the <code class="notranslate">good.playwright.ui.test.ts</code> to execute and pass since it's the example test from Playwright</p>
<p dir="auto"><strong>Actual</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: ERROR

   at bad.playwright.ui.test.js:1

&gt; 1 | throw new Error(&quot;ERROR&quot;);
    |       ^
  2 | //# sourceMappingURL=bad.playwright.ui.test.js.map
  3 |

    at Object.&lt;anonymous&gt; (C:\Users\...\Downloads\PortableCookie\bad.playwright.ui.test.js:1:7)

error Command failed with exit code 1."><pre class="notranslate"><code class="notranslate">Error: ERROR

   at bad.playwright.ui.test.js:1

&gt; 1 | throw new Error("ERROR");
    |       ^
  2 | //# sourceMappingURL=bad.playwright.ui.test.js.map
  3 |

    at Object.&lt;anonymous&gt; (C:\Users\...\Downloads\PortableCookie\bad.playwright.ui.test.js:1:7)

error Command failed with exit code 1.
</code></pre></div>
<p dir="auto">For some reason the <code class="notranslate">bad</code> Playwright test gets executed, if I remove the <code class="notranslate">//# sourceMappingURL=bad.playwright.ui.test.js.map</code> comment it works fine .</p>
<p dir="auto">This is very strange, I don't think this is by design.</p>
<p dir="auto">For more context, we have "Jest" and "Playwright" test files side by side as we are migrating runners..</p>