How to fix Browser agent not working in Antigravity?

Your Antigravity browser agent is not opening and the agent reports a Playwright error about HOME not being set. Here is the exact fix that gets the browser working again.

Antigravity browser button does nothing and agent reports Playwright HOME not set

Clicking the Antigravity browser icon does nothing, and asking the agent to open the browser returns an error. The underlying message states that Playwright cannot initialize because the HOME environment variable is missing on Windows. On Windows, many tools rely on USERPROFILE, but Playwright requires HOME. Without it, Playwright cannot download or use its browser binaries, so browser context creation fails even if your network is fine. If you are also encountering eligibility or project loading issues in Antigravity, see our guide on fixing an account not eligible error for a different root cause.

Solution Overview

AspectDetail
Root CauseMissing HOME environment variable on Windows blocks Playwright initialization
Primary FixSet HOME to USERPROFILE at the user level and restart your tools
ComplexityEasy
Estimated Time3 to 5 minutes

Fix Playwright not initializing due to missing HOME on Windows

Step-by-Step Solution

1. Set HOME via PowerShell for your user account recommended Run PowerShell as your user and execute:
[Environment]::SetEnvironmentVariable("HOME", $env:USERPROFILE, "User")
Optionally set it for the current PowerShell session so you can retry immediately without a restart:
$env:HOME = $env:USERPROFILE
Verify:
$env:HOME
You should see a path like C:\Users\YourName Close and reopen Antigravity or your IDE and then try the browser button again. 2. Test Antigravity browser features Open the same task that previously failed and confirm the browser launches. If it still fails, continue with the checks below. For related stuck project issues in the Google Stitch context, see this targeted help on a Stitch project not loading.

Alternative Fixes and Workarounds

1. Set HOME using Windows Settings user scope
  • Open Windows Search and type Environment Variables
  • Select Edit the system environment variables, then click Environment Variables
  • Under User variables, select New
  • Variable name: HOME
  • Variable value: %USERPROFILE%
  • Click OK and restart your IDE or Antigravity
Effectiveness rating: High same as PowerShell method 2. Set HOME at machine scope admin If you manage shared machines or services, set HOME for all users:
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
 "[Environment]::SetEnvironmentVariable('HOME', $env:USERPROFILE, 'Machine')"
Note that services may run under different accounts. Prefer the user scope unless you know you need machine scope. Effectiveness rating: High but broader impact 3. Ensure Playwright has its browsers installed If your stack expects a local Playwright install, run:
npx playwright install chromium
or for all:
npx playwright install
Effectiveness rating: Medium only needed in developer managed setups 4. Clear a corrupted Playwright cache and let it rebuild Delete the local cache directory and retry:
rmdir /s /q "%USERPROFILE%\AppData\Local\ms-playwright"
Then relaunch Antigravity or run:
npx playwright install chromium
Effectiveness rating: Medium for cache corruption cases

Troubleshooting Tips

  • Confirm HOME resolves to a valid directory
PowerShell: “` Test-Path $env:HOME “` It should return True. If not, set HOME again and ensure the folder exists.
  • Confirm permissions on HOME are writeable
Try creating a temp file: “` New-Item -ItemType File -Path “$env:HOME\playwright_write_test.txt” “` Then delete it.
  • Check for restricted sandbox environments
Some IDEs or agents override environment variables. Set HOME in the parent shell and relaunch the tool from that shell.
  • Review logs for Playwright initialization errors
Typical message: “` Playwright failed to initialize: required HOME environment variable is not set “` If you see unrelated network or token issues, that is a different problem. For thought token limits impacting tasks, see help for the 1024 tokens not thinking error.
  • If using proxies or security software
They should not block setting HOME, but they can block browser downloads. If needed, allowlist Playwright downloads. See Playwright installation info at Playwright Docs.

Best Practices

  • Always define HOME in Windows development and agent environments so tools that expect Unix style variables work consistently.
  • Prefer user scope for HOME to avoid side effects on services that run under different accounts.
  • Keep Playwright browsers in a predictable location and document the requirement in your project readme.
  • In CI set HOME to a writable workspace directory before running Playwright. See GitHub Actions environment variables and Playwright CI best practices.

Final Thought

The fix is straightforward. Set HOME to USERPROFILE, restart your tools, and Playwright will launch the browser normally in Antigravity. If symptoms persist after applying the steps above, revisit the alternative fixes and verify permissions and cache.

Leave a Comment