Problem Description
When attempting to use Google Antigravity, the browser-based functionality fails to start. The error message indicates that Playwright is unable to initialize because the required $HOME environment variable is not set.
Although Windows normally uses the USERPROFILE environment variable to represent the user’s home directory, Playwright and other Unix-oriented tooling explicitly rely on the HOME variable. In this environment, HOME is missing, which prevents Playwright from installing and launching its browser components (such as Chromium).
As a result, browser context creation fails, and Antigravity is unable to perform browser-based tasks, even though network connectivity itself is functioning correctly.
Root Cause
-
Playwright requires a valid
HOMEdirectory to store downloaded browsers, cache files, and browser profiles. -
On Windows,
HOMEis not guaranteed to be defined, especially in sandboxed, agent-based, or IDE-managed runtime environments. -
Without
HOME, Playwright fails during initialization.
Resolution
How to Fix the Issue
This issue happens because the HOME environment variable is missing on Windows. Playwright requires this variable to know where it can store browser files and temporary data.
You can fix this by setting the HOME variable manually.
Option 1: Set it using PowerShell (Recommended)
-
Open PowerShell.
-
Run the following command:
[Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")
- Close and reopen your IDE or terminal so the change can take effect.
Option 2: Set it manually via Windows Settings
-
Open Windows Search and type “Environment Variables”.
-
Select “Edit the system environment variables”, then click “Environment Variables”.
-
Under User variables, click New.
-
Set:
-
Variable name:
HOME -
Variable value:
%USERPROFILE%
-
-
Click OK, then restart your IDE.
Why This Works
Playwright needs a valid home directory to download and launch its browser (Chromium).
On Windows, this directory is usually stored in USERPROFILE, but some tools do not automatically map it to HOME. Setting HOME resolves the issue.