Skip to content

Go to Definition doesn't point to the SFC Source for global components (registered by unplugin-vue-components) #4817

@ferferga

Description

@ferferga

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

1.92.2

Vue version

3.5.1

TypeScript version

5.5.4

System Info

No response

package.json dependencies

"devDependencies": {
    "@types/node": "22.5.2",
    "@vitejs/plugin-vue": "5.1.3",
    "typescript": "5.5.4",
    "unplugin-vue-components": "0.27.4",
    "vite": "5.4.2",
    "vue-tsc": "2.1.6"
  },
  "dependencies": {
    "vue": "3.5.1"
  }

Steps to reproduce

  1. Download the project locally, open in VSCode and install all dependencies
  2. In App.vue, right click over JTransition > Go to definition
  3. Repeat 2 for JSuspense

What is expected?

JTransition location is inferred from the type definition export that it's automatically added by `unplugin-vue-components.

What is actually happening?

JSuspense source is shown correctly, but JTransition is being redirected to components.d.ts file.

Link to minimal reproduction

https://stackblitz.com/edit/vue3-vite-typescript-starter-2bi7tj?file=src%2FApp.vue

Any additional comments?

Found multiple issues with somewhat a similar issue, but all of them were using the old shim declaration files and Nuxt, which is not my reproduction case. Also saw suggested using Takeover mode, and even a 2 PRs (1) (2) but it's now deprecated with the hybrid mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions