vim-prettier icon indicating copy to clipboard operation
vim-prettier copied to clipboard

"Prettier: failed to parse buffer" on write when autoformat_config_present is used

Open foxbunny opened this issue 4 years ago • 4 comments

Do you want to request a feature or report a bug?

This is a bug report.

What is the current/expected behavior?

I'm running into an issue where if I have

let g:prettier#autoformat_config_present = 1

in my .vimrc, vim-prettier will trigger on write, but fail with Prettier: failed to parse buffer.

If I simply issue the :Prettier command, it works as expected and formats the file.

The expected behavior is for formatting to be performed without errors on :w

What version of vim-prettier are you using - (output of :PrettierVersion) ?

1.0.0-beta

What version of prettier are you using - (output of :PrettierCliVersion) ?

2.0.2

What is your prettier executable path - (output of :PrettierCliPath) ?

/node_modules/.bin/prettier

Did this work in previous versions of vim-prettier and/or prettier ?

Not sure, first time using it.

foxbunny avatar Apr 03 '21 20:04 foxbunny

After a bit of digging around, I find that :PrettierAsync is not working either throwing the same error.

foxbunny avatar Apr 03 '21 20:04 foxbunny

did you find a solution? thanks

fabOnReact avatar Apr 04 '21 07:04 fabOnReact

did you find a solution? thanks

Sadly, no.

foxbunny avatar Apr 04 '21 21:04 foxbunny

I fixed this by using coc-prettier which is compatible with the ruby plugin

fabOnReact avatar Apr 05 '21 05:04 fabOnReact