Gemini Code Assist v2.59.0 in VS code on my Mac M1 is giving this error without fail - tokenizeFunc: context canceled panic: runtime error: invalid memory address or nil pointer dereference
The issue
This error is a known, recurring bug within the Gemini Code Assist extension for VS Code, specifically affecting users on certain operating systems or hardware configurations, including some on macOS M1/M2 chips.
The traceback shows a Go language panic (panic: runtime error: invalid memory address or nil pointer dereference), which is an internal crash within the extension’s backend process (written in Go), often triggered during the code analysis/tokenization phase (tokenizeFunc).
Since version 2.57, similar issues have been widely reported. The most reliable solution is to downgrade the extension version.
The fix
Recommended Fix: Downgrade the Extension The version you are running, v2.59.0, appears to be affected by this instability. The best immediate fix is to roll back to a known stable version.
-
Open Extensions View: In VS Code, go to the Extensions tab (Cmd+Shift+X on Mac).
-
Find the Extension: Search for Gemini Code Assist.
-
Access Downgrade Menu: Click the gear icon (⚙️) next to the extension.
-
Select Downgrade: Choose “Install Another Version…”
-
Install Stable Version: Select a version prior to 2.57.0, such as 2.56.0 or 2.55.0. These older versions are frequently cited by users as stable.
-
Disable Auto-Update: To prevent VS Code from immediately updating it again, click the gear icon (⚙️) again and select “Disable Auto Update” for the extension.
-
Restart VS Code: Completely close and reopen VS Code to ensure the downgraded version loads correctly.
Closing thoughts
I performed the downgrade and its been around 5 minutes, looks like it fixed it. Let’s wait for that new version. Right, back to getting some things done.

