Neovim version (nvim -v)
NVIM v0.12.2
Operating system/version
Windows 11 / MSYS2
Read debugging tips
Add the debug logs
Log file
2026-06-22 14:32:38[ERROR] Formatter 'sql_formatter' error in vim.system: vim/_core/system.lua:326: ENOENT: no such file or directory
2026-06-22 14:36:30[ERROR] Formatter 'sql_formatter' error in vim.system: vim/_core/system.lua:326: ENOENT: no such file or directory
2026-06-22 14:37:54[ERROR] Formatter 'sql_formatter' error in vim.system: vim/_core/system.lua:326: ENOENT: no such file or directory
2026-06-22 14:38:23[ERROR] Formatter 'sql_formatter' error in vim.system: vim/_core/system.lua:326: ENOENT: no such file or directory
2026-06-22 14:42:36[ERROR] Formatter 'sql_formatter' error in vim.system: vim/_core/system.lua:326: ENOENT: no such file or directory
2026-06-22 15:54:05[ERROR] Formatter 'stylua' error: error: could not format from stdin: failed to format from stdin: error parsing:
- unexpected token `,` (30:31 to 30:32), expected a field
- unexpected token `:` (32:13 to 32:14), expected `function` after attributes
- unexpected token `(` (5:25 to 5:26), expected `)` to close function call
- unexpected token `remove` (32:15 to 32:21), expected arguments after `:`
- unexpected token `fixed` (32:27 to 32:32), unexpected expression when looking for a statement
- unexpected token `upstream` (32:33 to 32:41), unexpected expression when looking for a statement
- unexpected token `sql_formatter` (33:5 to 33:18), unexpected expression when looking for a statement
- unexpected token `,` (37:6 to 37:7), trailing commas are not allowed
- unexpected token `}` (38:3 to 38:4), unexpected token, this needs to be a statement
- unexpected token `,` (42:4 to 42:5), trailing commas are not allowed
- unexpected token `}` (43:1 to 43:2), unexpected token, this needs to be a statement
Describe the bug
Hello,
I noticed that the sql-formatter.lua is not detecting the path correctly on MSYS2 when installed via node_modules. I believe the issue is here:
Which should instead be similar to how prettier is detected (please refer to workaround below):
Using :ConformInfo you can see it doesn't use the *.cmd executable as expected for Windows machines:
Other formatters:
clang_format ready (cpp, h, c) C:\msys64\ucrt64\bin\clang-format.EXE
prettier ready (jsonc, json, markdown, typescript, typescriptreact, javascript, javascriptreact, html, css, yaml) C:
\msys64\home\lemon\projects\liga\prototype\node_modules\.bin\prettier.cmd
shfmt unavailable: Command 'shfmt' not found
sql_formatter ready (sql) C:\msys64\home\lemon\.nvm\versions\node\v24.11.1\bin\sql-formatter
stylua ready (lua) C:\msys64\usr\bin\stylua.EXE
Workaround
As a workaround (and possible) solution I had to add the following:
sql_formatter = {
command = require("conform.util").from_node_modules(
require("conform.fs").is_windows and "sql-formatter.cmd" or "sql-formatter"
),
},
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
- setup nvim on MSYS2.
- add
sql = { "sql_formatter" }, to conform setup.
- open an
*.sql file and attempt to format.
- error observed in
:ConformInfo and in logs.
Expected Behavior
Same behavior as prettier when detecting the executable from node_modules on MSYS2.
Minimal example file
vim.pack.add({
"https://www.github.com/stevearc/conform.nvim",
})
require("conform").setup({
formatters_by_ft = {
sql = { "sql_formatter" },
},
format_on_save = {
timeout_ms = 5000,
lsp_format = "fallback",
},
})
Minimal init.lua
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"stevearc/conform.nvim",
config = function()
require("conform").setup({
log_level = vim.log.levels.DEBUG,
formatters_by_ft = {
sql = { "sql_formatter" },
},
})
end,
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Additional context
No response
Neovim version (nvim -v)
NVIM v0.12.2
Operating system/version
Windows 11 / MSYS2
Read debugging tips
Add the debug logs
log_level = vim.log.levels.DEBUGand pasted the log contents below.Log file
Describe the bug
Hello,
I noticed that the
sql-formatter.luais not detecting the path correctly on MSYS2 when installed vianode_modules. I believe the issue is here:Which should instead be similar to how
prettieris detected (please refer to workaround below):Using
:ConformInfoyou can see it doesn't use the*.cmdexecutable as expected for Windows machines:Workaround
As a workaround (and possible) solution I had to add the following:
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
sql = { "sql_formatter" },to conform setup.*.sqlfile and attempt to format.:ConformInfoand in logs.Expected Behavior
Same behavior as
prettierwhen detecting the executable fromnode_moduleson MSYS2.Minimal example file
Minimal init.lua
Additional context
No response