playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Bug]: [Route Interception] route.fetch() hangs in mcr.microsoft.com/playwright:v1.52.0-jammy (works in v1.45.2)

Open vineet-kumar59 opened this issue 7 months ago • 0 comments

Version

1.52

Steps to reproduce

Describe the bug

When upgrading from Playwright v1.45.2 to v1.52.0 (Docker image mcr.microsoft.com/playwright:v1.52.0-jammy), a test that intercepts and modifies a network response (**/a/auth/login) hangs indefinitely at await route.fetch(). The same test works fine in v1.45.2.

Minimal Reproduction

import { test, expect } from '@playwright/test';

test('Repro: route.fetch() hangs', async ({ page }) => {
  await page.route('**/a/auth/login', async (route) => {
    console.log('Route intercepted, attempting fetch...'); // 👈 Logs this but hangs
    const response = await route.fetch(); // ❌ Stuck here
    const body = await response.json();
    await route.fulfill({ json: { ...body, modified: true } });
  });

  await page.goto('https://example.com/login');
  await page.click('button#login'); // Triggers the intercepted request
});



### Expected behavior

It should fetch the response 

### Actual behavior

Interception Starts but Hangs:

    The route is registered (confirmed via logs).

    The request is made (visible in traces).

    Hangs indefinitely at await route.fetch() (no error/timeout).

Test Flow Breakdown:
plaintext

[Test starts] → [Route registered] → [Request made] → [Interception triggered]  
→ [Stuck at fetch()] → [Timeout after 60s]

### Additional context

Works in: mcr.microsoft.com/playwright:v1.45.2-jammy (same test passes).

Debugging Attempts:

    Verified the request URL is correct (logged via page.on('request')).

    Tried route.continue() as fallback → no improvement.

    Removed --user 1001:1000 → no effect.

    Enabled traces → shows the request is made but never resolved.

GitHub Actions Logs:
text

Route intercepted, attempting fetch...  # Last log before hang

### Environment

```shell
Playwright Version: 1.52.0

    Docker Image: mcr.microsoft.com/playwright:v1.52.0-jammy

    OS: GitHub Actions (Ubuntu)

    Node.js: (e.g., 16.x, 18.x)

    Browser: Chromium (default)

vineet-kumar59 avatar Jun 16 '25 04:06 vineet-kumar59