Jump to content

Biome

From NixOS Wiki

Biome is a fast formatter and performant linter for JavaScript, TypeScript, JSX, JSON, CSS and GraphQL.

Troubleshooting

Issue: Biome LSP in Neovim failed on NixOS due to dynamic linking error.

Logged in /home/incogshift/.local/state/nvim/lsp.log:

[ERROR] Could not start dynamically linked executable [...] NixOS cannot run dynamically linked executables intended for generic\nlinux environments out of the box [...]

Fix

Edit: ~/.local/share/nvim/mason/bin/biome

Look for a section like this:

const PLATFORMS = {
	...
	darwin: {
		x64: "@biomejs/cli-darwin-x64/biome",
		arm64: "@biomejs/cli-darwin-arm64/biome",
	},
	linux: {
		x64: "@biomejs/cli-linux-x64/biome",
		arm64: "@biomejs/cli-linux-arm64/biome",
	},
	...
};

Replace the architecture path of your OS with the absolute path to biome in your system. Find it using:

$ which biome
/etc/profiles/per-user/<user>/bin/biome

Then update the block (assuming x64 Linux as the platform):

const PLATFORMS = {
	...
	darwin: {
		x64: "@biomejs/cli-darwin-x64/biome",
		arm64: "@biomejs/cli-darwin-arm64/biome",
	},
	linux: {
		x64: "/etc/profiles/per-user/<user>/bin/biome",
		arm64: "@biomejs/cli-linux-arm64/biome",
	},
	...
};

Reference for similar issues: Stack Overflow