question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Extension 'Vetur' cannot format" when Template interpolation service is enabled

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: 0.31.0
  • VS Code version: 1.51.1

Problem

Similarly to https://github.com/vuejs/vetur/issues/2009, formatting does not work, but kicks in if I disable and re-enable “Template interpolation service”. It stops working again after restarting VSCode though, so I currently need to toggle the “Template interpolation service” off and on after every VSCode restart.

Reproducible Case

  • Create a new Vue app, e.g. via the CLI (doesn’t seem to matter how it’s created)
  • Enable the “Template interpolation service” in Vetur settings
  • Restart VSCode
  • Open a vue file and call “Format document”

Actual: “Extension ‘Vetur’ cannot format …” appears in the bottom panel. Note that no errors are logged in “Vue Language Server” output. Expected: The document is formatted

Workaround

  • Go to Vetur settings
  • Toggle the “Template interpolation service” off and on again
  • Formatting works as expected until next VSCode restart

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yoyo930021commented, Dec 9, 2020

Is there a rough estimation on when this fix is released in the vscode marketplace? In the meantime, I installed version 0.30.3 manually. That fixes the format problem for me.

Release in v0.31.1

1reaction
fardoliericommented, Dec 9, 2020

Is there a rough estimation on when this fix is released in the vscode marketplace? In the meantime, I installed version 0.30.3 manually. That fixes the format problem for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Interpolation Support | Vetur - GitHub Pages
Compile original Vue template into a virtual TypeSript file; Generate a sourcemap between expressions in original .vue file and the virtual file; Run...
Read more >
Vue/TypeScript/ESLint/Prettier/Vetur formatting doesn't work
I want VS Code to lint and format my .vue and .ts files when I save. I have spent hours and tried many,...
Read more >
VSCode Vetur Template Interpolation Service
VSCode Vetur extension enable option · Mouse over variable in template · Possibly 'undefined' · Use v-if to make sure 'info' has value....
Read more >
CHANGELOG.md · igiting/vetur - Gitee.com
Syntax Highlighting for SugarSS. Thanks to contribution from @softwaredeveloptam. #2828. Fix component data not shown in hover when template interpolation ...
Read more >
How I Resolved Vue.js, VSCode, Vetur, Prettyhtml, and ...
By default, Vetur (The VS Code Vue.js Extension) uses Prettyhtml as the default html formatter. Which wraps Prettier and adds a bunch of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found