[Bug] Antigravity crashes on OAuth login: Uncaught TypeError: Do not know how to serialize a BigInt

Hello team,

I encountered a critical crash in the Antigravity desktop client during the OAuth login flow on Windows. I managed to identify the root cause and implemented a temporary workaround, but this requires a proper fix in the core codebase.

Description

When authenticating the application, the browser successfully completes the authorization and redirects back to the app via the antigravity://oauth-success/ protocol. However, the application fails to process the callback. The main process throws an uncaught TypeError because the underlying code uses JSON.stringify() on a payload or state object that contains a BigInt value.

Environment

  • OS: Windows 10/11 (win32-x64)
  • Version/Commit: 135ccf460c67c4b900

Steps to Reproduce

  1. Launch Antigravity and trigger the sign-in flow.
  2. Complete the OAuth verification in the browser.
  3. The browser attempts to redirect to the app (antigravity://oauth-success/...).
  4. The application window becomes unresponsive to the login success, and the logs reveal a main process crash.

Error Logs

[main 2026-03-26T03:52:40.540Z] app#handleProtocolUrl(): antigravity://oauth-success/ { originalUrl: 'antigravity://oauth-success/' }
[main 2026-03-26T03:52:40.540Z] URLHandlerRouter#routeCall() with URI argument antigravity://oauth-success/
[main 2026-03-26T03:52:41.671Z] [uncaught exception in main]: TypeError: Do not know how to serialize a BigInt
[main 2026-03-26T03:52:41.671Z] TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at vD (file:///D:/Antigravity/resources/app/out/main.js:31:11765)
    at nve.o (file:///D:/Antigravity/resources/app/out/main.js:31:14636)
    at nve.m (file:///D:/Antigravity/resources/app/out/main.js:31:14511)

Workaround / Suggested Fix

I was able to bypass the crash and successfully log in by injecting the following polyfill at the very beginning of resources/app/out/main.js:

JavaScript

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

To permanently fix this, please either implement a replacer function in the JSON.stringify calls that handle the auth payload/storage, or apply a similar polyfill globally.

Thank you!

Hi @he_Cieve ,

Welcome to the Forum!
Thank you for the workaround.
Our engineering team is currently investigating the matter, and we appreciate your patience as we work toward a resolution.