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.

Early access to Architect Forward (architectFWD™) Enterprise

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.

  1. Open Extensions View: In VS Code, go to the Extensions tab (Cmd+Shift+X on Mac).

  2. Find the Extension: Search for Gemini Code Assist.

  3. Access Downgrade Menu: Click the gear icon (⚙️) next to the extension.

  4. Select Downgrade: Choose “Install Another Version…”

  5. 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.

  6. 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.

  7. 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.

Quintes van Aswegen

Quintes van Aswegen

24+ years experience in solving business problems and maximising opportunities through technology in a variety of industries, public and private sector internationally. I founded architectFWD™ to provide knowledge and trusted advice in the areas of strategy, technology, cloud and digital to enable organisations to become Digital Leaders.