Skip to content

Instantly share code, notes, and snippets.

@Abd2023
Last active May 18, 2026 08:11
Show Gist options
  • Select an option

  • Save Abd2023/206fbfedf1e4531e8cad0a285357d8b7 to your computer and use it in GitHub Desktop.

Select an option

Save Abd2023/206fbfedf1e4531e8cad0a285357d8b7 to your computer and use it in GitHub Desktop.
Fix for Antigravity App Login Crash (TypeError: Do not know how to serialize a BigInt)

Fix: Antigravity App Login Crash (BigInt Serialization Error)

The Problem

When attempting to sign in to the Antigravity desktop app via Google OAuth, the app fails to open the browser for authentication. No visible error is shown in the user interface, but the login process silently stalls.

Diagnosing the Issue

To understand what is happening behind the scenes, you can run the application with Node's inspector attached.

Step 1: Open PowerShell or Command Prompt. Step 2: Navigate to the Antigravity installation folder:

cd "C:\Users\$env:USERNAME\AppData\Local\Programs\Antigravity"

Step 3: Launch the app with the debugger flag:

.\Antigravity.exe --inspect=9229

When you click "Sign in with Google", you would normally expect the app to spin up a local auth server and log an [Auth] port. Instead, the terminal immediately throws the following fatal crash:

[uncaught exception in main]: TypeError: Do not know how to serialize a BigInt

The Cause

The app's background processes are attempting to convert a BigInt data type into JSON string format. Because JavaScript's native JSON.stringify() does not know how to handle BigInt values by default, it throws a TypeError and crashes the authentication sequence before the browser can even launch.

The Solution

To fix this, we need to apply a small patch to the app's core JavaScript file to teach it how to safely serialize BigInt values.

Choose your operating system below:


Method A: For Windows

Step 1: Close the Application

Ensure Antigravity and any associated terminal windows are completely closed.

Step 2: Locate the Core File

Open Notepad, or your preferred code editor.

Go to File > Open. Ensure the file type is set to All Files (*.*).

Navigate to and open the following file, replacing <YourUsername> with your actual Windows username:

C:\Users\<YourUsername>\AppData\Local\Programs\Antigravity\resources\app\out\main.js

Step 3: Apply the Patch

The main.js file is minified, so you will see a massive block of text. You only need to edit the very beginning of the file.

Place your cursor at Line 1, right after the opening copyright comment ends, and inject this exact prototype function:

BigInt.prototype.toJSON = function() { return this.toString(); };

Before:

/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/var O5n=Object.cre

After:

/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/BigInt.prototype.toJSON = function() { return this.toString(); }; var O5n=Object.cre

Step 4: Save and Restart

Save the file and launch Antigravity normally.


Method B: For Linux (Ubuntu / Debian)

Note: On Linux, the main.js file is in a protected system directory (/usr/share/) and is minified into a single, massive line of code. Opening it in standard GUI text editors like Gedit or Nano will often cause them to freeze or crash. The fastest and safest way to apply the fix is entirely through the terminal.

Step 1: Close the Application

Ensure the Antigravity app is completely closed.

Step 2: Run the Patch Commands

Open your terminal and run the following commands one by one. This will create a backup, inject the fix at the top of the file, and replace the broken original. (You will be prompted for your sudo password).

# Navigate to the app's core directory
cd /usr/share/antigravity/resources/app/out/

# Create a safe backup of the original file
sudo cp main.js main.js.backup

# Create a temporary file with our BigInt fix at the very top
echo "BigInt.prototype.toJSON = function() { return this.toString(); };" > /tmp/fixed_main.js

# Append the massive original file to the bottom of our new temporary file
cat main.js >> /tmp/fixed_main.js

# Replace the broken original file with our newly fixed file
sudo mv /tmp/fixed_main.js main.js

Step 3: Launch and Log In

Launch Antigravity normally from your terminal or application menu.


The Result

When you click "Sign in with Google", the app will now gracefully bypass the telemetry crash, launch your default web browser, and successfully capture the OAuth callback.

Note

If Antigravity receives a major software update, this file may be overwritten. You may need to reapply this patch if the developers have not addressed the bug upstream.

@Abd2023
Copy link
Copy Markdown
Author

Abd2023 commented Mar 23, 2026

you are welcome!

@daryn100100-dot
Copy link
Copy Markdown

thank u so much bro, it helped

@rodsoa83
Copy link
Copy Markdown

Hey! Still not working for me. I've run with the debugger, but I don't see any errors. Here is what I'm getting:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\rodrigo.soares> cd "C:\Users$env:USERNAME\AppData\Local\Programs\Antigravity"
PS C:\Users\rodrigo.soares\AppData\Local\Programs\Antigravity>
PS C:\Users\rodrigo.soares\AppData\Local\Programs\Antigravity>
PS C:\Users\rodrigo.soares\AppData\Local\Programs\Antigravity> .\Antigravity.exe --inspect=9229
PS C:\Users\rodrigo.soares\AppData\Local\Programs\Antigravity>
Debugger listening on ws://127.0.0.1:9229/919314a2-af8c-4f2c-b545-096a3992aef2
For help, see: https://nodejs.org/en/docs/inspector
[main 2026-03-24T13:35:13.281Z] [BrowserOnboardingClientMainService] Starting browser onboarding server
[main 2026-03-24T13:35:13.371Z] [BrowserOnboardingClientServer] Browser onboarding server started on http://localhost:58795
[main 2026-03-24T13:35:13.439Z] update#setState idle
[main 2026-03-24T13:35:43.444Z] update#setState checking for updates
[main 2026-03-24T13:35:43.505Z] update#setState idle

In the front-end, still seeing: "There was an unexpected issue setting up your account.".

Do you have any other ideas, please?

Thank you!

@Abd2023
Copy link
Copy Markdown
Author

Abd2023 commented Mar 24, 2026

@rodsoa83
Hey Rodrigo,

The good news is that since you aren't seeing that TypeError: Do not know how to serialize a BigInt in your logs, your app isn't actually crashing! You can even see that your local auth server successfully spun up on port 58795.

I'm pretty sure the error you're running into is actually a server-side or backend issue with Antigravity, rather than a local desktop bug. It looks like the app successfully received your login, but Google's servers are rejecting the account initialization.

Here are a few possibilities for what's going wrong and how to fix them:

Account glitch or empty quota: You might have run out of your quota, or there's just a backend glitch tied to your specific account. Fix: Try logging in with a completely different account.

Regional restrictions: Some server regions are currently bugged out. Fix: Turn on a VPN, connect to a different country, and try logging in again.

Stuck cache: Sometimes old login tokens get stuck in the app's memory. Fix: Close the app, go to C:\Users\YOUR_USERNAME\AppData\Roaming\Antigravity (your %APPDATA% folder), delete the cache folders, and try again.

If these solutions don't fix it, honestly idk man, you will probably have to contact Antigravity support to see what's going on with their servers.

@Liudeguang
Copy link
Copy Markdown

thank you,bro

@Horley1
Copy link
Copy Markdown

Horley1 commented Mar 25, 2026

thank you!!!!!

@hudiohizari
Copy link
Copy Markdown

Thank youu, was wondering why one of my google account cannot login!

@Egir1121
Copy link
Copy Markdown

It worked, appreciate it, thnx

@ChocoRin43
Copy link
Copy Markdown

thx buddy, it worked

@hypednol
Copy link
Copy Markdown

hypednol commented Apr 5, 2026

thanks

@Himanshuoo
Copy link
Copy Markdown

thanks everyone I had also this issue one simple solution works for me for windows navigate to search bar and search foe "Windows Subsystem" right click on that and uninstall that and restart the Antigravity this will surely work if above solution doesn't works for you.

@vatsalkoriya
Copy link
Copy Markdown

idk i follow whole steps it gave me the javascript error in the main process

@jackzhujie
Copy link
Copy Markdown

mac intel hao to fix it?

@magisph
Copy link
Copy Markdown

magisph commented Apr 21, 2026

Fix Antigravity App Login Error

After trying several methods, I was able to identify the problem in my case: malicious redirection in the hosts file.

Google Antigravity uses specific Google Cloud endpoints to process authentication (such as cloudcode-pa.googleapis.com and daily-cloudcode-pa.googleapis.com). It happens that the Windows hosts file might contain entries that redirect Google API domains to 127.0.0.1 (localhost), preventing any connection between Antigravity and Google's servers.


DIAGNOSIS (Check if You Have the Same Problem)

1. Open the Command Prompt as Administrator

2. Test DNS Resolution

Type the following command and press Enter:

nslookup cloudcode-pa.googleapis.com

Expected result (normal):

Name:    cloudcode-pa.googleapis.com
Addresses:  142.250.79.170
          172.217.172.10
          142.250.218.234
          [other numerical IP addresses]

If you see Google IPv6 addresses (starting with 2800:), it is also correct.

3. Test the Actual Connection

Type the following command and press Enter:

curl -v [https://cloudcode-pa.googleapis.com](https://cloudcode-pa.googleapis.com)

Expected result (normal):

* IPv4: [REAL GOOGLE IP ADDRESS]
* Trying [IP]:443...
* Connected to cloudcode-pa.googleapis.com port 443

PROBLEMATIC result (indicates the problem):

* IPv4: 127.0.0.1
* Trying 127.0.0.1:443...
* connect to 127.0.0.1 port 443 failed: Connection refused

If you see 127.0.0.1 instead of the real IP, you have the same problem. Proceed to Part 2.


FIXING THE PROBLEM

1. Open the hosts File

In the Command Prompt (Admin), type:

notepad %SystemRoot%\System32\drivers\etc\hosts

The hosts file will open in Notepad.

2. Locate the Problematic Entries

Search the file for any line containing cloudcode or googleapis. You are looking for lines similar to these:

127.0.0.1 cloudcode-pa.googleapis.com
127.0.0.1 daily-cloudcode-pa.googleapis.com

Screenshot of how the problem looked in the hosts file:

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# [...] (standard Windows comments)
#
# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost

127.0.0.1 daily-cloudcode-pa.googleapis.com    <-- PROBLEMATIC LINES
127.0.0.1 cloudcode-pa.googleapis.com          <-- PROBLEMATIC LINES

3. Remove the Malicious Entries

Select and remove only the two lines that contain cloudcode-pa.googleapis.com and daily-cloudcode-pa.googleapis.com.

4. Save the File

5. Flush the DNS Cache

In the Command Prompt, type:

ipconfig /flushdns

You should see: Successfully flushed the DNS Resolver Cache

Step 6: Restart the Computer


VERIFYING THE FIX

After restarting, run the tests again to confirm that the problem has been resolved.

Test 1: nslookup

nslookup cloudcode-pa.googleapis.com

Confirm: It should show numerical IP addresses from Google (not 127.0.0.1).

Test 2: curl

curl -v [https://cloudcode-pa.googleapis.com](https://cloudcode-pa.googleapis.com)

Confirm: It should show "Connected to [REAL IP ADDRESS] port 443" — 127.0.0.1 should not appear.


USING GOOGLE ANTIGRAVITY

After the fix, to sign in to Antigravity:

  1. Open Google Antigravity (close and reopen it if it was already open)
  2. Click on "Sign in with Google"
  3. Complete the authentication flow in the browser as usual
  4. Wait — the error "There was an unexpected issue setting up your account" should no longer appear

If the login is successful, you will see the main Antigravity interface.

@bynkook
Copy link
Copy Markdown

bynkook commented May 9, 2026

it is wonder this is 2026 may and this issue still persist in fresh new install. what google is doing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment