Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier: failed to parse buffer on html.erb file with vim editor #9

Open
kevinhq opened this issue Feb 22, 2021 · 4 comments
Open
Labels
question Further information is requested

Comments

@kevinhq
Copy link

kevinhq commented Feb 22, 2021

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?

@adamzapasnik
Copy link
Owner

Hey 👋
Could you run ./node_modules/.bin/prettier --check . --color and see if html.erb files get picked up?
Are there any errors?

@adamzapasnik adamzapasnik added the question Further information is requested label Feb 22, 2021
@kevinhq
Copy link
Author

kevinhq commented Feb 26, 2021

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?

@adamzapasnik
Copy link
Owner

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?

@evenreven
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants