conform.nvim icon indicating copy to clipboard operation
conform.nvim copied to clipboard

bug: error starting prettierd for html files

Open egnvk opened this issue 1 year ago • 1 comments

Neovim version (nvim -v)

v0.10.0

Operating system/version

Arch kernel 6.9.6

Add the debug logs

  • [X] I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

Log file: /home/egn/.local/state/nvim/conform.log 07:54:54[DEBUG] prettierd stderr: { "" } 07:54:54[ERROR] Formatter 'prettierd' error:

Describe the bug

I get an error when I try to save the html file

Formatter failed. See :ConformInfo for details  ```

i am use default config conform 
require("conform").setup({
	format_on_save = {
		timeout_ms = 500,
		lsp_fallback = true,
		async = false,
		-- quiet = true,
	},
	log_level = vim.log.levels.DEBUG,
	formatters_by_ft = {
		lua = { "stylua" },
		-- Conform will run multiple formatters sequentially
		python = { "isort", "black" },
		-- Use a sub-list to run only the first available formatter
		javascript = { { "prettierd", "prettier" } },
		typescript = { "prettierd" },
		javascriptreact = { "prettierd" },
		typescriptreact = { "prettierd" },
		css = { "prettierd" },
		html = { "prettierd" },
		json = { "prettierd" },
		yaml = { "prettierd" },
		markdown = { "prettierd" },
		graphql = { "prettierd" },
	},
})


### What is the severity of this bug?

minor (annoyance)

### Steps To Reproduce

default configs of all plugins:
lazy nvim
mason
conform
there is nothing else. globally installed prettierd

### Expected Behavior

the file will be formatted

### Minimal example file

_No response_

### Minimal init.lua

```Lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"

if not (vim.uv or vim.loop).fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable", -- latest stable release
		lazypath,
	})
end

vim.opt.rtp:prepend(lazypath)

local plugins = {
	-- color themes
	{ "rebelot/kanagawa.nvim", lazy = false, name = "kanagawa" },

        -- mason package manager
        { "williamboman/mason.nvim", lazy = true },

        -- conform formatter
        {
          'stevearc/conform.nvim',
          opts = {},
        }
}

require("lazy").setup(plugins)

Additional context

node.js 20.14 version

egnvk avatar Jun 26 '24 00:06 egnvk

The log file appears to be truncated, because it should be showing you the prettierd command that it was running. You should find that in the logs and run it directly to see how it performs. Usually this process reveals an issue with the formatter itself.

stevearc avatar Jul 16 '24 07:07 stevearc