Vim-prettier: Prettier: failed to parse buffer.

Created on 5 Aug 2018  路  6Comments  路  Source: prettier/vim-prettier

Do you want to request a feature or report a bug?
bug
What is the current/expected behavior?
should format file, instead gives error "Prettier: failed to parse buffer."
it does work if i just use :Prettier

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.14.0
What is your prettier executable path - (output of :PrettierCliPath) ?
prettier
Did this work in previous versions of vim-prettier and/or prettier ?
yes, im not sure why its not working anymore.

here is my .vimrc just in case it helps. I am using macos version 10.13.6

https://gist.github.com/yshuman1/88902bbd6ff4341b9e619a935ce63d62

Most helpful comment

Closing this issue for now as you have been unblocked.

I will resume working on vim-prettier in 2 weeks, been very busy at work at this stage as I am about to go on paternity leave in the next 2 weeks.

Will then comment in this issue my findings on further debugging this

All 6 comments

Thanks for reporting this issue will look into it now and comment in this issue

hi @mitermayer, i think i figured it out. its my bash terminal thats messing it up. for whatever reason the line in my vimrc shell=bash\ --login is causing prettier to break. when i comment it out everything in prettier is fine.

do you see anything here that would be breaking it?

`export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin
export GOPATH=$HOME/go
export GOROOT="/usr/local/go"
export PATH=$PATH:$GOPATH/bin
export GOBIN=$HOME/go/bin
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH=$PATH:/usr/local/mysql/bin/
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/usr/local/opt/python@2/libexec/bin:$PATH"

Enable tab completion

source ~/.bash_git
source ~/git-completion.bash
source ~/.git-prompt.sh

colors!

green="[\033[0;32m]"
blue="[\033[0;34m]"
purple="[\033[0;35m]"
reset="[\033[0m]"

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

Change command prompt

source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1

'\u' adds the name of the current user to the prompt

'\$(__git_ps1)' adds git-related stuff

'\W' adds the name of the current directory

export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"

export NVM_DIR="/Users/yasin/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

The next line updates PATH for the Google Cloud SDK.

if [ -f '/Users/yasin/google-cloud-sdk/path.bash.inc' ]; then source '/Users/yasin/google-cloud-sdk/path.bash.inc'; fi

The next line enables shell command completion for gcloud.

if [ -f '/Users/yasin/google-cloud-sdk/completion.bash.inc' ]; then source '/Users/yasin/google-cloud-sdk/completion.bash.inc'; fi
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk
export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk

export PATH="$HOME/.cargo/bin:$PATH"`

Closing this issue for now as you have been unblocked.

I will resume working on vim-prettier in 2 weeks, been very busy at work at this stage as I am about to go on paternity leave in the next 2 weeks.

Will then comment in this issue my findings on further debugging this

thank you and congrats on the new arrival!

I also have a custom shell command, and it prevents :PrettierAsync from working. :Prettier works fine, but async does not. Is there a way around this other than removing our custom shell command?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdimitroulas picture cdimitroulas  路  5Comments

tugorez picture tugorez  路  7Comments

ajcrites picture ajcrites  路  8Comments

n-xlkt picture n-xlkt  路  5Comments

alex-shamshurin picture alex-shamshurin  路  10Comments