Vetur: Extension Vetur cannot format MyComponent.Vue

Created on 10 Nov 2020  路  6Comments  路  Source: vuejs/vetur

Heya! I'm not sure why but Vetur doesn't run on some of my projects.
I have made one of them easily clonable so you can try reproduce it. Vetur won't run at all for me but not sure why. : )
I think I did the setup correctly though!!

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ
  • [x] I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS Catalina
  • Vetur version: v0.29.1
  • VS Code version: Version: 1.51.0

Problem

image

image

Reproducible Case

git clone https://github.com/fergusmeiklejohn/cycraft
git checkout vetur-issue
yarn
code .

Then navigate to any vue file and press 鈱楽

question

Most helpful comment

You have "vetur.format.enable": false, in your local .vscode/settings.json.

All 6 comments

You have "vetur.format.enable": false, in your local .vscode/settings.json.

@rchl thanks so much!!! I can't believe I spent so long trying to figure it out, when it's a simple stupid oversight! :P

@yoyo930021 is it maybe possible to change the error message from

Extension 'Vetur' cannot format 'src/App.vue'

to something like:

Extension 'Vetur' did not format because it is disabled

@rchl thanks so much!!! I can't believe I spent so long trying to figure it out, when it's a simple stupid oversight! :P

@yoyo930021 is it maybe possible to change the error message from

Extension 'Vetur' cannot format 'src/App.vue'

to something like:

Extension 'Vetur' did not format because it is disabled

I can't do it in LSP. =_=

Ok, thanks anyway! : )
cya around!!

for anyone else having this problem. I had to remove something like this from my settings.json for it to format again:

...,
 "[vue]": {
        "editor.tabSize": 2,
        "editor.defaultFormatter": "..."
 },
 ...

@sebastianjung Thank you very much! That solved it for me.

Was this page helpful?
0 / 5 - 0 ratings