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

Created on 8 Dec 2020  路  7Comments  路  Source: vuejs/vetur

  • [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
  • 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
bug

All 7 comments

I'm experiencing the exact same issue since today.

Same issue today

Beside above i'm experiencing some other issues also, for example this piece of code,

<h1>{{ product.title }}</h1>

It underlines the product and gives the following error,

Property 'product' does not exist on type 'CombinedVueInstance<Record<never, any> & Vue, object, object, object, Record<never, any>>'.Vetur(2339)

NuxtJS doesn't throw an error, everything is working fine so i'm not sure why Vetur thinks it's a problem since today.

Beside above i'm experiencing some other issues also, for example this piece of code,

<h1>{{ product.title }}</h1>

It underlines the product and gives the following error,

Property 'product' does not exist on type 'CombinedVueInstance<Record<never, any> & Vue, object, object, object, Record<never, any>>'.Vetur(2339)

NuxtJS doesn't throw an error, everything is working fine so i'm not sure why Vetur thinks it's a problem since today.

https://vuejs.github.io/vetur/guide/FAQ.html#property-xxx-does-not-exist-on-type-combinedvueinstance

Fixed in 7af21d7

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KokoDoko picture KokoDoko  路  3Comments

octref picture octref  路  3Comments

shaunc picture shaunc  路  3Comments

LukeLin picture LukeLin  路  3Comments

thibautguedou3 picture thibautguedou3  路  3Comments