Skip to content

[Regression]: "PLAYWRIGHT_BROWSERS_PATH=0" no longer prevents evaluation of "defaultCacheDirectory" on Android/Termux #41852

Description

@Jobians

Last Good Version

1.58.2

First Bad Version

latest

Steps to reproduce

  1. Install the latest Playwright in Termux.
  2. Set "PLAYWRIGHT_BROWSERS_PATH=0".
  3. Run any Playwright command (e.g. "npx playwright install").
  4. Observe "Unsupported platform: android".

"defaultCacheDirectory" is evaluated before "PLAYWRIGHT_BROWSERS_PATH=0" is respected.

Expected behavior

When PLAYWRIGHT_BROWSERS_PATH=0 is set, Playwright should not evaluate defaultCacheDirectory.

Instead, it should respect the explicit browser path as it did in previous releases, allowing Playwright to run on Termux without triggering the Android unsupported-platform check.

This was the previous behavior and allowed Termux users to provide their own browser installation.

Actual behavior

Playwright evaluates defaultCacheDirectory before checking the PLAYWRIGHT_BROWSERS_PATH override.

On Android/Termux this causes the platform check to execute first, resulting in:

Unsupported platform: android

This happens even when PLAYWRIGHT_BROWSERS_PATH=0 is set and an explicit browser path is provided.

As a result, the override no longer avoids the unsupported-platform check, unlike previous versions.

Additional context

This appears to be a regression.

Previously, PLAYWRIGHT_BROWSERS_PATH=0 prevented evaluation of defaultCacheDirectory, allowing Termux users to provide an explicit browser path.

I previously opened a PR #41683 proposing to defer evaluation of defaultCacheDirectory until it is actually needed. The PR was closed because the motivation was unclear.

The motivation is to restore the previous behavior where an explicit PLAYWRIGHT_BROWSERS_PATH override is respected before any default cache directory or platform-specific logic is evaluated.

If this behavior is intentional, could you clarify why PLAYWRIGHT_BROWSERS_PATH is no longer honored before evaluating defaultCacheDirectory?

Environment

System:
    OS: android
    CPU: Unknown
    Memory: 2.25 GB / 7.44 GB
  Binaries:
    Node: 26.3.1 - /data/data/com.termux/files/usr/bin/node
    npm: 11.17.0 - /data/data/com.termux/files/usr/bin/npm
    pnpm: 11.9.0 - /data/data/com.termux/files/usr/bin/pnpm
    Deno: 2.9.1 - /data/data/com.termux/files/usr/bin/deno
  Languages:
    Bash: 5.3.9 - /data/data/com.termux/files/usr/bin/bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions