Skip to content

Type hinting does not work in Vue SFC template part #4739

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

Closed
Salmon42 opened this issue Aug 29, 2024 · 9 comments · Fixed by #4740
Closed

Type hinting does not work in Vue SFC template part #4739

Salmon42 opened this issue Aug 29, 2024 · 9 comments · Fixed by #4740
Labels
bug Something isn't working

Comments

@Salmon42
Copy link

Salmon42 commented Aug 29, 2024

Vue - Official extension or vue-tsc version

2.1.0

VSCode version

1.92.2

Vue version

Nuxt 3

TypeScript version

5.5.2

System Info

System:
    OS: Linux 5.10 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
    Memory: 47.21 GB / 49.59 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.14.0/bin/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v20.14.0/bin/npm

Steps to reproduce

After last update to v2.1.0 the typehinting / intellisense stops working in Vue SFC's template part - everything is inferred to any, even though the given references are correctly declared in <script setup>.

What is expected?

In single previous version 2.0.28, the opened source file looks like this:
image
image

What is actually happening?

image
image

Link to minimal reproduction

No response

Any additional comments?

To note, I was using Nuxt3 at that time, and the AccomodationCard component was auto-imported into the SFC automatically (through autogenerated directory .nuxt). I haven't tested this behavior on pure Vue3 setup or anywhere else.

My current workaround was to specifically revert the extension to version 2.0.28

@RayGuo-ergou
Copy link
Contributor

RayGuo-ergou commented Aug 29, 2024

Reproduced in neovim too, by checking the log no error throw and can get generic vue proprieties (is, key and ref).

image

To get workaround in neovim, after downgrade to 2.0.28, have also to pin volar version. see: #4706 (comment)

@Soveilove
Copy link

yes.2.1.0 it does not support corresponding function cabinets

@FilePlus
Copy link

image I also encountered the same problem.

@l246804
Copy link

l246804 commented Aug 29, 2024

+1

@moonwane
Copy link

moonwane commented Aug 29, 2024

+1
all globally typed components are now of "any" type

image

@davidmatter
Copy link
Collaborator

davidmatter commented Aug 29, 2024

Workaround for now: Add the following to your tsconfig.compilerOptions:

"paths": {
      "vue/__globalTypes_3.4_false": ["node_modules/vue/__globalTypes_3.4_false.d.ts"]
}

@liuheo
Copy link

liuheo commented Aug 29, 2024

+1 all globally typed components are now of "any" type

I also encountered this problem, I lowered the version to v2.0.28 and it worked fine.

@kingyue737
Copy link
Contributor

I upgraded to v2.1.2 but still encountered this issue

@Artles777
Copy link

v. 2.2.8 issue too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.