'How to fix VS COde "fatal error: runtime: bsdthread_register error" on MacOS Monterey

I'm getting "fatal error: runtime: bsdthread_register error" error on VS code when i try to run a command on terminal.

This used work fine on Big sur and older versions.

Is there a way to get this fixed on Monterey?



Solution 1:[1]

If this is a program you built from source, you will need to rebuild it with a newer version of Go:

https://github.com/golang/go/wiki/MacOS12BSDThreadRegisterIssue

Solution 2:[2]

This might not be the issue of vscode. If you open your shell terminal, the error might still be there. Try changing your default terminal to zsh instead of bash. You can follow this to see how to change the vscode default terminal.

Solution 3:[3]

The same situation happens when I use goimports command after upgrading go version to 1.17. Try to upgrade your go tools, Good Luck!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cody Gray
Solution 2 YifanG
Solution 3 Jipeng Li