prettier / prettier/vim-prettier

Prettier: failed to parse buffer (PrettierAsync) for every JS file

Open
#171 41 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Vim Script
Stars
1.8k
Forks
137
PR merge metrics
No merged PRs in 30d

Description

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

What is the current/expected behavior?
Using PrettierAsync always results in the error Prettier: failed to parse buffer. Prettier command works fine (on every file).

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

What is your prettier executable path - (output of :PrettierCliPath) ?
/Users/dsaenger/code/titan-web/node_modules/.bin/prettier
(local project path)

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

To be clear: This error always occurs with whatever JS file when using :PrettierAsync, even Hello World:

console.log('Hello World');

.. but :Prettier works fine.

I'm using https://github.com/skwp/dotfiles vim config .. maybe vim-prettier does not work with another plugin .. how can I debug this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with :PrettierAsync on the minimal JavaScript example, then compare it with the working :Prettier command using vim-prettier 0.2.7, Prettier 1.16.1, and the reported local executable path. Done means asynchronous formatting accepts ordinary JavaScript files without the parse-buffer error while the synchronous command continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.