Skip to content

lang="js" and js/ts.preferGoToSourceDefinition co-usage triggers tsserver debug failure #6064

@x0rsw1tch

Description

@x0rsw1tch

Vue - Official extension or vue-tsc version

3.3.1 / 6.0.3

VSCode version

1.120.0

Vue version

3.5.34

TypeScript version

6.0.3

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 AMD Ryzen 9 7900X 12-Core Processor
    Memory: 19.19 GB / 63.10 GB
  Binaries:
    Node: 24.13.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.12.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.3 - C:\Users\tom\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Chrome: 147.0.7727.138
    Edge: Chromium (140.0.3485.54)
    Internet Explorer: 11.0.22621.3527

package.json dependencies

"dependencies": {
    "vue": "^3.5.32"
  },
  "devDependencies": {
    "@tsconfig/node24": "^24.0.4",
    "@types/node": "^24.12.2",
    "@vitejs/plugin-vue": "^6.0.6",
    "@vue/eslint-config-typescript": "^14.7.0",
    "@vue/tsconfig": "^0.9.1",
    "eslint": "^10.2.1",
    "eslint-config-prettier": "^10.1.8",
    "eslint-plugin-oxlint": "~1.60.0",
    "eslint-plugin-vue": "~10.8.0",
    "jiti": "^2.6.1",
    "npm-run-all2": "^8.0.4",
    "oxlint": "~1.60.0",
    "prettier": "3.8.3",
    "typescript": "~6.0.0",
    "vite": "^8.0.8",
    "vite-plugin-vue-devtools": "^8.1.1",
    "vue-tsc": "^3.2.6"
  },

Steps to reproduce

  1. All extensions disabled, except Sublime text keymap, theme, and Vue (Official)
  2. Use npm create vue@latest and create a blank project with TypeScript support
  3. npm i
  4. Convert /src/App.vue to use Options API (see linked repo)
  5. Define a variable in the root app that will be passed to the
  6. Create a child component that accepts a prop from the root app (see linked repo)
  7. Add an instance of the child component in the root app (see linked repo)
  8. Try to use "Go to Definition" on the component in the template, or the variable

What is expected?

Using "Go To Definition" command goes to:

  • The Vue component when used on a component
  • The variable wherever it is defined when used on a variable

What is actually happening?

When using "Go to Definition" or "Go to Type Definition" within the template, the result says "no definition found". When looking at the Extension Host logs, this message appears:

2026-05-20 14:21:43.257 [error] Error: <semantic> TypeScript Server Error (6.0.3)
Cannot read properties of undefined (reading 'getSourceFile')
TypeError: Cannot read properties of undefined (reading 'getSourceFile')
    at getValidSourceFile (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:153417:32)
    at Object.getDefinitionAtPosition2 [as getDefinitionAtPosition] (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:153955:71)
    at IpcIOSession.findSourceDefinition (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:196043:38)
    at findSourceDefinition (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:194941:43)
    at c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:197591:15
    at IpcIOSession.executeWithRequestId (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:197580:14)
    at IpcIOSession.executeCommand (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:197589:29)
    at IpcIOSession.onMessage (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\typescript.js:197637:68)
    at process.<anonymous> (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\node_modules\typescript\lib\_tsserver.js:519:14)
    at process.emit (node:events:519:28)
    at emit (node:internal/child_process:949:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
	at r.create (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:24:168)
	at r.dispatchResponse (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:2654)
	at r.dispatchMessage (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:1162)
	at ChildProcess.<anonymous> (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:379)
	at ChildProcess.emit (node:events:519:28)
	at emit (node:internal/child_process:949:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Another message that might appear in Extension Host is this:

[error] Error: <semantic> TypeScript Server Error (6.0.3)
Debug Failure. False expression: Script kind should match provided ScriptKind:3 and sourceFile.scriptKind: 1, !entry: false
Error: Debug Failure. False expression: Script kind should match provided ScriptKind:3 and sourceFile.scriptKind: 1, !entry: false
    at getDocumentRegistryEntry **********************\node_modules\typescript\lib\typescript.js:144625:11)
    at acquireOrUpdateDocument **********************\node_modules\typescript\lib\typescript.js:144655:32)
    at Object.acquireDocumentWithKey **********************\node_modules\typescript\lib\typescript.js:144591:12)
    at getOrCreateSourceFileByPath **********************\node_modules\typescript\lib\typescript.js:153603:31)
    at Object.getOrCreateSourceFile **********************\node_modules\typescript\lib\typescript.js:153582:14)
    at d:\Projects-Ethode\te-dotcms\node_modules\typescript\lib\typescript.js:153503:42
    at Object.getSourceFileWithCache [as getSourceFile] **********************\node_modules\typescript\lib\typescript.js:126901:24)
    at findSourceFileWorker **********************\node_modules\typescript\lib\typescript.js:129221:23)
    at findSourceFile **********************\node_modules\typescript\lib\typescript.js:129138:20)
    at d:\Projects-Ethode\te-dotcms\node_modules\typescript\lib\typescript.js:129089:22
    at getSourceFileFromReferenceWorker **********************\node_modules\typescript\lib\typescript.js:129060:26)
    at processSourceFile **********************\node_modules\typescript\lib\typescript.js:129087:5)
    at processRootFile **********************\node_modules\typescript\lib\typescript.js:128919:5)
    at d:\Projects-Ethode\te-dotcms\node_modules\typescript\lib\typescript.js:127692:41
    at forEach **********************\node_modules\typescript\lib\typescript.js:2309:22)
    at createProgram **********************\node_modules\typescript\lib\typescript.js:127692:5)
    at synchronizeHostDataWorker **********************\node_modules\typescript\lib\typescript.js:153534:15)
    at synchronizeHostData **********************\node_modules\typescript\lib\typescript.js:153429:7)
    at Object.getProgram **********************\node_modules\typescript\lib\typescript.js:153611:5)
    at AuxiliaryProject.updateGraphWorker **********************\node_modules\typescript\lib\typescript.js:188869:41)
    at AuxiliaryProject.updateGraph **********************\node_modules\typescript\lib\typescript.js:188692:32)
    at updateProjectIfDirty **********************\node_modules\typescript\lib\typescript.js:190535:36)
    at AuxiliaryProject.getLanguageService **********************\node_modules\typescript\lib\typescript.js:188289:7)
    at IpcIOSession.findSourceDefinition **********************\node_modules\typescript\lib\typescript.js:196042:31)
    at findSourceDefinition **********************\node_modules\typescript\lib\typescript.js:194941:43)
    at d:\Projects-Ethode\te-dotcms\node_modules\typescript\lib\typescript.js:197591:15
    at IpcIOSession.executeWithRequestId **********************\node_modules\typescript\lib\typescript.js:197580:14)
    at IpcIOSession.executeCommand **********************\node_modules\typescript\lib\typescript.js:197589:29)
    at IpcIOSession.onMessage **********************\node_modules\typescript\lib\typescript.js:197637:68)
    at process.<anonymous> **********************\node_modules\typescript\lib\_tsserver.js:519:14)
    at process.emit (node:events:519:28)
    at emit (node:internal/child_process:949:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
	at r.create (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:24:168)
	at r.dispatchResponse (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:2654)
	at r.dispatchMessage (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:1162)
	at ChildProcess.<anonymous> (c:\Program Files\Microsoft VS Code\0958016b2a\resources\app\extensions\typescript-language-features\dist\extension.js:26:379)
	at ChildProcess.emit (node:events:519:28)
	at emit (node:internal/child_process:949:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

Oddly enough, hovering over the components and variables to get information about them seems to be fine.

Image

Alt+clicking on prop names takes you to the component as expected, but no idea why "go to definition" is failing on most other things within <template>. "Go to definition" also seems to work fine within the <script> portion of the component.

Link to minimal reproduction

https://github.com/x0rsw1tch/vuejs-lsp-bug-test

Any additional comments?

I don't know if this is an issue with Vue (Official), or with Typescript Language Features.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions