TIL

Rebuild Treesitter Parsers After Architecture Change

Treesitter parsers are compiled binaries specific to CPU architecture. When migrating between Intel and Apple Silicon Macs (or running under Rosetta), parsers will fail with cryptic errors.

Symptoms:

Fix:

# Delete existing parsers
rm -rf ~/.local/share/nvim/site/parser/

# Rebuild all parsers for current architecture
nvim -c "TSInstall! all" -c "qa"

Or from within Neovim:

:TSInstall! all

The ! forces reinstallation even if parsers exist. This rebuilds every parser for your current CPU architecture.

This also applies when: