-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Bug: failed to parse buffer. #214
Comments
I have this same problem. Maybe it's because I updated to a later version. Anyone else getting "failed to parse buffer"? |
Same here. It seems to be quite a recurring issue, according to the number of github issues regarding this specific error. EDIT: Okay, my problem might not be related to this issue in fact. I just have a |
Stepping back to [email protected] fixed it for me with vim-prettier 0.2.7. I thought this was weird since the OP reported they were using 1.18.2. So, to make sure it wasn't something unrelated, I double checked by reinstalling 1.19.0. Got the error. Downgraded to 1.18.2. No more error. |
For what it's worth, I'm also seeing issues with prettier version |
failed to handle type conversion "arg as string" for tsx (vim prints filetype as typescriptreact) but, cli works just fine. |
I am almost on holidays from work, and will look at this issues from tomorrow :) |
For what it's worth, I am having the same problem. It seems to be related to the file type. I tried switching from With the two previous plugins the filetype was typescript.tsx and everything worked, now it is typescriptreact and fails. For now I solved this by putting |
Hi @koljakube, Great finding, this explain a lot. I previously had removed the filetypes definition from the release/1.x branch due to relying on prettier itself to be capable of identifying the filetype based on extension. I will re-add that back and dig on upstream to understand what can be going wrong within the communication between vim-prettier and prettier itself |
I have reincluded file type definitions and branch 1.0 has been merged into master. Is anyone still facing this issues ? Please comment/reopen this issue if you are still facing this issue |
Still encountering this issue. Neovim: 0.4.3 I've tried removing and reinstalling prettier and it has worked with previous versions. Just downgraded to 0.9x branch and have had no issues. Plugins: call plug#begin("~/.vim/plugged") "Tpope plugins "Javascript / React "ruby / rails "html / css "Markdown previewing, Ensure you have nodejs and yarn " Snippets " Linting " Autocompletion |
Thanks for including your config it is super helpful , I will investigate this issue with neovim and comment in here |
Let me know if there's any other way I can help. My full config is here: https://github.com/ParamagicDev/config-files/blob/master/dotfiles/vimrc I haven't tested whether it works in regular vim yet. I'll test it next time I'm at my computer. I'll also try removing plugins 1 by 1. Who knows, it could be a plug-in compatibility issues. |
So I found that the issue comes up specifically in this repository when editing https://github.com/ParamagicDev/ma-protocol-rewrite/tree/development I've tried changing the default parser to Babylon and that did not fix the issue. I swapped over into one of my rails projects and did not encounter the issue with My best guess is that EDIT: I removed my The issue only occurs with 1.0.0-alpha. The issue does not occur with the '0.x' branch. The issue occurs both when I use neovim and regular vim. The issue resolves when I remove The issue does not occur when using command line prettier. |
hi @ParamagicDev Thank you for the snippet, I am able to reproduce this issue on my end! This bug seems to be something related to the Will keep digging into it and comment in here any findings |
@ParamagicDev It looks like the problem is that one of can you please try the following and see if you can still repro this error:
With the above i was no longer able to repro that issue |
@mitermayer Thank you so much for this. Everything's working as expected now. |
Closing this issue now, feel free to comment or reopen this issue if anyone experience same problem again |
I'm still having issues with this. If I remove my |
@nratter Perhaps a syntax error with your |
@kyle-dormer There were no syntax errors in my |
I can confirm that this bug is still live on the latest version of vim-prettier. The solution for me was to install both |
I don't know why this PR is |
Further, I have no determined that normal typescript files (
|
I also have this bug, newest vim-prettier. for some reason, when I switched to using prettier through coc-prettier instead of vim-prettier, everything worked just fine |
Same here. I think this issue should be reopened. |
For future folks who discover this issue, I ended up switching to ale + prettier instead and it's working flawlessly. Once you install Ale (I did it via Plug), you just add this to your .vimrc let g:ale_fix_on_save = 1
let g:ale_fixers = {
\ 'javascript': ['prettier', 'eslint'],
\ 'typescript': ['prettier', 'eslint'],
\} |
I still have this issue when I try to format manually with |
I am still having this issue! Interestingly its not there for typescript files! Also, |
Me too still have issue and in my case json files are able to format just fine its Yaml file which gives this error Prettier: Failed to parse buffer (PrettierAsync) |
I was having this issue as well. My prettier config was formatted as JS using |
Also seeing this issue with a fresh install and running |
I was already using ALE, and that works great! Eslint is a bit slow but just leaving prettier is what I wanted anyways :) Thanks @theycallmeswift ! |
Was getting this error for files without an extension. Dissapeared after adding .js extention. |
Do you want to request a feature or report a bug?
Bug.
What is the current/expected behavior?
Prettier cannot format the file due to
Prettier: failed to parse buffer.
This occurs both on save and when executing the:Prettier
andPrettierAsync
commands manually. The same error occurs on both macvim and neovim.What version of
vim-prettier
are you using - (output of:PrettierVersion
) ?0.2.7
What version of
prettier
are you using - (output of:PrettierCliVersion
) ?1.18.2
What is your
prettier
executable path - (output of:PrettierCliPath
) ?prettier
Did this work in previous versions of vim-prettier and/or prettier ?
Previously worked on neovim, not working on macvim. However, the last time it was used was months ago and I can't give a specific version that it worked under.
This is off of a clean prettier install. I don't know if it would be due to other plugins but below are the plugins I have enabled:
The text was updated successfully, but these errors were encountered: