language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Pug Typescript validation messed up after update from Volar

Open timsayshey opened this issue 3 months ago • 9 comments

This wasn't happening before the update, if I switch to tags it works but does not work for Pug:

image

This started as soon as TypeScript Vue Plugin (Volar) was deprecated. My guess is not all features were ported into the main extension.

timsayshey avatar Mar 13 '24 21:03 timsayshey

Incase anyone ends up in this situation, you can downgrade back to the working extensions by downloading and installing the previously working Volar VSIX extensions here: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Vue/vsextensions/volar/0.17.6/vspackage https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Vue/vsextensions/vscode-typescript-vue-plugin/1.8.27/vspackage

Make sure you turn off auto-update.

timsayshey avatar Mar 13 '24 22:03 timsayshey

Have you installed the @vue/language-plugin-pug plugin?

so1ve avatar Mar 14 '24 02:03 so1ve

@so1ve Yes, here are my Vue packages:

"@volar/vue-language-plugin-pug": "^1.6.5",
"@vue/language-plugin-pug": "^2.0.6",
"@vueuse/core": "^10.2.1",
"vue": "^3.3.4",
"vue-router": "^4.0.0",
"vue-tsc": "^1.8.4",
"eslint-plugin-vue": "^9.23.0",

timsayshey avatar Mar 14 '24 02:03 timsayshey

Could you please share your tsconfig.json?

so1ve avatar Mar 14 '24 02:03 so1ve

{
  "extends": "@quasar/app-vite/tsconfig-preset",
  "vueCompilerOptions": {
    "target": 3,
    "skipTemplateCodegen": false, // For Volar Extension
    "plugins": [
      "@volar/vue-language-plugin-pug"
    ],
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "*": ["node_modules/*", "path/to/your/modules/*"]
    },
  },
  "compilerOptions": {
    "baseUrl": ".",
    "module": "es2015",
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "allowJs": true
  },
  "include": [
    "./src/**/*"
  ],
}

timsayshey avatar Mar 14 '24 02:03 timsayshey

Your vueCompilerOptions is outdated. Replace

"skipTemplateCodegen": false, // For Volar Extension
"plugins": [
  "@volar/vue-language-plugin-pug"
],

with

"plugins": [
  "@vue/language-plugin-pug"
],
···

so1ve avatar Mar 14 '24 02:03 so1ve

And the latest version of Volar is 2.0.6 (v1 is 1.8.27). Please make sure the plugin version matches your Volar version.

so1ve avatar Mar 14 '24 03:03 so1ve

Thanks - oddly enough there was no pop up message warning me about the upgrades or deprecation or that I needed to update my tsconfig to keep things working - but I'll try that out when I get some time

timsayshey avatar Mar 14 '24 17:03 timsayshey

good day! I can't figure out why it doesn't work, everything is installed in accordance with the recommendations

image image image image

And the latest version of Volar is 2.0.6 (v1 is 1.8.27). Please make sure the plugin version matches your Volar version.

SolidKane avatar Apr 05 '24 10:04 SolidKane