prettier-plugin-erb
prettier-plugin-erb copied to clipboard
Prettier: failed to parse buffer on html.erb file with vim editor
Details: I install it using npm, and confirm it by running npm list
:
k@ /Users/k
├── @prettier/[email protected]
├── [email protected]
└── [email protected]
But, when I run :Prettier
on vim opening html.erb editor, it gets the error: Prettier: failed to parse buffer
On .rb file (which is supported by plugin-ruby itself), it works.
Any idea how to fix this?
Hey :wave:
Could you run ./node_modules/.bin/prettier --check . --color
and see if html.erb files get picked up?
Are there any errors?
hi.
no error. html.erb get picked up, and I see warns about [warn] Code style issues found in the above file(s). Forgot to run Prettier?
Complete output:
Checking formatting...
[warn] app/views/events/index.html.erb
[warn] Code style issues found in the above file(s). Forgot to run Prettier?
Thanks. It doesn't seem like a problem with the plugin? I'm not sure what is the problem as I haven't use vim prettier plugin.
Maybe you could open up an issue there https://github.com/prettier/vim-prettier and they would point us towards a solution?
@kevinhq I would try the amazing vim ALE plugin with Prettier to rule out issues with your local env. Try to set Prettier as your ALE fixer, and then use :ALEFix. I use this and don't have any issues.