Vetur: There is no selection formatter for 'vue'-files installed.

Created on 3 Jul 2018  路  8Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

Info

  • Platform: Win 10
  • Vetur version: 0.12.5
  • VS Code version: 1.24.1

Problem

Can't format .vue files. I'm trying to format .vue files from a Vue project made using CLI.
Error "There is no selection formatter for 'vue'-files installed." appears.
It does not work when you save the file either

Vue file

image

Extensions

image

My settings

image

question

Most helpful comment

Added this line to get html formatting to work

{
  // Default formatter for <template> region
  "vetur.format.defaultFormatter.html": "prettier",
}

All 8 comments

Sam problem on Win 10.

We only have a whole document formatter, no range formatter.

Added this line to get html formatting to work

{
  // Default formatter for <template> region
  "vetur.format.defaultFormatter.html": "prettier",
}

@martinnaughton I get "value is not accepted"; I can only choose None and js-beautify-html. (prettier installed)

I resolved my problem with the followed code in the Visual studio code setting
{
"vetur.format.defaultFormatter.html": "js-beautify-html"
}

document formatting works with the vetur pack. Lock at your shortcuts

Specifying formatter for only SCSS should be an option. It works when I set
"vetur.format.defaultFormatter.html": "js-beautify-html"
even though I don't have it installed.

Was this page helpful?
0 / 5 - 0 ratings