vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.62k stars 378 forks source link

[@volar-plugins/typescript] sourceFile not found #2500

Closed henrychea closed 1 year ago

henrychea commented 1 year ago

This error [@volar-plugins/typescript] sourceFile not found ....vue.js keeps appearing server output in VueJS 2.6.x app whether takeover mode is enabled or disabled.

This is my jsconfig.json

{
  "compilerOptions": {
    "strict": true,
    "module": "es2015",
    "target": "es2015",
    "moduleResolution": "node",
    "baseUrl": "wwwroot/js/",
    "allowJs": true
  },
  "vueCompilerOptions": {
    "target": 2,
    "extensions": [
      ".vue"
    ],
    "experimentalDisableTemplateSupport": true
  }
}

And volar config

const vetur = require('@volar-plugins/vetur')
const prettyhtml = require('@volar-plugins/prettyhtml');
module.exports = {
  plugins: [
    vetur(),
        prettyhtml({ printWidth: 80, wrapAttributes: true, sortAttributes: true, singleQuote: false }),
  ]
}
johnsoncodehk commented 1 year ago

Can you reproduce this problem in https://github.com/johnsoncodehk/volar-starter? If not please provide minimal reproduction so that I can check it.

henrychea commented 1 year ago

Sorry for the delay, here you go: https://github.com/henrychea/volar-vuejs2-ts-check-issue-repoduce

It seems to only happen when you create a new .vue file, and after you save close and reopen the file it no longer produces that error.

image