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

1.0.0-alpha: error upon save file: Error detected while processing function...

Open city41 opened this issue 5 years ago • 8 comments

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

What is the current/expected behavior? Upon saving a file, expecting it to format the code. But instead getting

Error detected while processing function prettier#Prettier[33]..prettier#job#runner#run[2]..<SNR>86_asyncFormat[14]..prettier#job#async#ne
ovim#run:
line   23:

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

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

What is your prettier executable path - (output of :PrettierCliPath) ? /home/matt/dev/jumpclub/node_modules/.bin/prettier

(ie, the local prettier inside my project)

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

I think so. I am setting up a new machine and I believe when I installed my vim plugins it picked up a newer version of vim-prettier. But I am not totally sure.

Other info vim version: NVIM v0.4.0-1655-gc190415dc OS: Ubuntu 18.04

I installed the 0.x release and do not get the error. The 0.x version seems to be behaving as expected.

and btw, thanks for making this plugin, super useful!

city41 avatar Feb 27 '20 18:02 city41

Thank you for reporting this! Will try checking with this new release of NVIM as it may be an incompatibility. Will aim to send a fix in the next couple days If i can repro it locally

mitermayer avatar Feb 28 '20 00:02 mitermayer

Hi @city41,

I have just submitted some fixes for Neovim on https://github.com/prettier/vim-prettier/commit/f10100e0b48effa9a20052ea9fc634b521c0072d,

Do you mind trying to see if you still have the same issues ?

mitermayer avatar Mar 21 '20 13:03 mitermayer

This issue has been fixed

mitermayer avatar Mar 22 '20 09:03 mitermayer

I think I still have the problem. When I save a file I get

Error detected while processing function prettier#Prettier[33]..prettier#job#runner#run[2]..<SNR>85_asyncFormat[14]..prettier#job#async#ne ovim#run:

I went into my plugged directory and confirmed I have the latest vim-prettier. I did that by looking at the file autoload/prettier/job/async/neovim.vim and confirming it has the added redraw! on line 63.

city41 avatar Mar 22 '20 21:03 city41

Hi @city41

Will reopen this issue and look into it again

mitermayer avatar Mar 25 '20 23:03 mitermayer

I have the same problem here.

marcelarie avatar Jan 16 '21 11:01 marcelarie

I have this problem as well though my work around is this:

autocmd BufWritePre *.md,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.vue,*.yaml,*.html silent! PrettierAsync

Not the nicest thing, but it stops this error.

johnpangalos avatar Jun 08 '21 13:06 johnpangalos

FYI: I also encountered same problem but I noticed that this happens only if you have

set shell=/bin/bash\ -i
" This usually helps in allowing usage of aliases and funcions from .bashrc file.

in your ~/nvim/init.vim (~/.vimrc) file.

By removing that the issue got resolved!

sahilrajput03 avatar Mar 11 '22 09:03 sahilrajput03