How to fix Browser agent not working in Antigravity?

Your Antigravity browser agent is not opening. The agent reports an error and Playwright fails to start because the HOME environment variable is missing on Windows.

Antigravity browser agent not opening due to missing HOME on Windows

The browser icon is clicked but nothing opens, and commands to open the browser return an error. Logs indicate Playwright cannot initialize because HOME is not set, so it cannot create its browser cache or profiles.

Solution Overview

Aspect Detail
Root Cause HOME is not defined on Windows, so Playwright cannot locate a writable home directory for browsers and cache.
Primary Fix Set HOME to your Windows user profile path and restart the app or terminal.
Complexity Easy
Estimated Time 5 to 10 minutes
Read More: Account not eligible troubleshooting

Fix Antigravity browser startup failure HOME on Windows

Step-by-Step Solution

1. Verify the problem in your current session 1. Open PowerShell. 2. Check if HOME is set:
echo $env:HOME
If nothing is printed, HOME is missing. 2. Set HOME permanently for your Windows user account recommended 1. In PowerShell, run:
[Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")
2. Close and reopen your terminal or restart your IDE or agent host so the change takes effect. 3. Confirm the variable:
[Environment]::GetEnvironmentVariable("HOME", "User")
echo $env:HOME
You should see a path like C:\Users\YourName. 3. Relaunch the agent and test the browser 1. Start Antigravity again. 2. Click the browser icon or trigger a browser task. 3. The browser should open and Playwright should no longer report HOME errors. 4. If needed install or refresh Playwright browsers Sometimes the first run needs to download Chromium.
  • If you have Node.js available, you can run:
npx playwright install chromium
  • If you do not use Node.js directly, simply retry the Antigravity browser task and let it download automatically.
For background, see Playwright getting started docs: Playwright Docs Read More: Stitch project not loading fix

Alternative Fixes and Workarounds

Set HOME only for the current PowerShell session
  • Quick test without a restart:
$env:HOME = $env:USERPROFILE
  • Then retry the browser action in the same session.
Set HOME using Windows Settings interface 1. Open Windows Search and type Environment Variables. 2. Select Edit the system environment variables then click Environment Variables. 3. Under User variables choose New. – Variable name: HOME – Variable value: %USERPROFILE% 4. Click OK on all dialogs and restart your IDE or agent host. Set HOME from Command Prompt
setx HOME "%USERPROFILE%"
Close and reopen your terminal after running this. Use a custom Playwright browsers path optional If HOME cannot be set for policy reasons, you can direct Playwright to a writable folder:
[Environment]::SetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH", "$env:USERPROFILE\AppData\Local\ms-playwright", "User")
Then restart and retry. Read More: Fix tokens not thinking error

Troubleshooting Tips

  • Confirm write access to the target directory:
– It should be under C:\Users\YourName and not a network or read only path.
  • Make sure HOME resolves correctly:
– PowerShell: “` echo $env:HOME Test-Path $env:HOME “` – Command Prompt: “` echo %HOME% “`
  • Clear a corrupted Playwright cache to force a clean download:
“`powershell Remove-Item -Recurse -Force “$env:USERPROFILE\AppData\Local\ms-playwright” “` Then retry so Playwright re downloads its browsers.
  • Temporarily disable antivirus or add an allow list entry if downloads are being quarantined.
  • Run your IDE or agent host as a standard user first. If it fails only under an elevated context, set HOME for that context too:
“`powershell [Environment]::SetEnvironmentVariable(“HOME”, $env:USERPROFILE, “Machine”) “` Note that Machine scope affects all users. Prefer User scope when possible.
  • Check that there is sufficient disk space in the user profile.

Best Practices

  • Keep HOME consistently defined for your user account on Windows to avoid tooling confusion across shells and runtimes.
  • Prefer a local user profile path for HOME instead of a network drive for reliability.
  • After environment changes, restart the app or terminal to ensure the new values load.
  • Periodically clean old Playwright caches if you switch versions often.

Final Thought

Setting HOME to your Windows user profile resolves Playwright initialization and gets the Antigravity browser agent working again. Follow the quick PowerShell method above and you should be back in action within minutes.

Leave a Comment