Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ferferga opened this issue Sep 5, 2024 · 0 comments

Comments

@ferferga
Copy link
Contributor

ferferga commented Sep 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants