"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:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Release in v0.31.1
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.