Browser agent not working

I clicked on the browser icon, but the browser did not open. Is this a bug? And am I the only one experiencing this?

I also instructed the agent to open the browser, but he said there was an error there.

3 Likes

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 HOME directory to store downloaded browsers, cache files, and browser profiles.

  • On Windows, HOME is 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)

  1. Open PowerShell.

  2. Run the following command:

[Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")

  1. Close and reopen your IDE or terminal so the change can take effect.

Option 2: Set it manually via Windows Settings

  1. Open Windows Search and type “Environment Variables”.

  2. Select “Edit the system environment variables”, then click “Environment Variables”.

  3. Under User variables, click New.

  4. Set:

    • Variable name: HOME

    • Variable value: %USERPROFILE%

  5. 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.

10 Likes

got it thanks bro the solution is worked for me :heart_eyes:

1 Like

thank you for your solution , it works :+1:

Thanks for the proper explanations. This works for me

A SOLUÇÃO: Precisamos simplesmente criar um ponteiro permanente para a sua pasta de usuário no Windows. Abra o PowerShell (Administrador) e execute o seguinte comando (Substitua SeuNome pelo seu nome de usuário do Windows):

powershell
[Environment]::SetEnvironmentVariable(“HOME”, “C:\Users\SeuNome”, “User”)

ApĂłs executar o comando, reinicie o Antigravity e seu navegador nativo estarĂĄ funcionando normalmente! :shield::high_voltage:

Thank you for sharing this solution and for your detailed report on the root cause!

It is very helpful to have the specific fix confirmed—manually setting the HOME environment variable to point to the user profile is a great workaround for the Playwright initialization failure on Windows.

We appreciate you taking the time to update the community with these steps!