Skip to content

Components type inference and highlighting got broken in version 0.40.0 #1711

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
jagoncalves14 opened this issue Aug 11, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@jagoncalves14
Copy link

jagoncalves14 commented Aug 11, 2022

Looks like since Volar 0.40 was released that Components lost highlighting and type inference in my project.

This seems to be happening in versions 0.40.0 and 0.40.1
To confirm this, I rolled back VSCode's Volar plugin to version 0.39.5 and everything came back to work as before.

Example below:

In version 0.39.5 👇
image

In version 0.40.1 👇
image

Notes:
Typescript version: 4.7.4

@jagoncalves14 jagoncalves14 changed the title Type inference broken since version 0.40 Components type inference and highlighting got broken in version 0.40.* Aug 11, 2022
@jagoncalves14 jagoncalves14 changed the title Components type inference and highlighting got broken in version 0.40.* Components type inference and highlighting got broken in version 0.40.0 Aug 11, 2022
@francoism90
Copy link

"error ts7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer."

Downgrading to 0.39.5 solves the issue.

@ameryu716
Copy link

I am the same.
I had the same issue with all .vue and .ts files.
Reverting the Volar version to 0.395 works fine.

I appreciate this extension. thank you for always.

@Ragura
Copy link

Ragura commented Aug 13, 2022

This might not be the exact same issue because mine wasn't fixed by downgrading Volar's version. I had the same problem and thought it was caused by Volar, but it turned out to be caused by the plugin unplugin-vue-components. If you are using a recent version of the plugin together with pnpm, you need to take extra steps to resolve the issue (add shamefully-hoist to .npmrc). For more information, read this issue: unplugin/unplugin-vue-components#477

After following the instructions in the last post on the linked issue, intellisense worked again, even with the latest version of Volar.

@jagoncalves14
Copy link
Author

jagoncalves14 commented Sep 4, 2022

Updated the extension version to the recent 0.40.6 and the issue seems to be resolved.

@francoism90, @ameryu716 — can you also confirm this, so I can close the issue?

@francoism90
Copy link

francoism90 commented Sep 4, 2022

@jagoncalves14 It indeed seem to fix the issues, many thanks! :)

@cawa-93
Copy link

cawa-93 commented Sep 5, 2022

Still got similar issue when checks types by vue-tsc v.0.40.7 in nuxt rc-9

components/SingoutAndNavigateLink.vue:1:25 - error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectl
y in its own initializer.

  1 <script lang="ts" setup>
                            
  2 import { useCookie } from '#imports'
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 10 }
    ~
 11 </script>
   

components/CabinetHeader.vue:1:25 - error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its 
own initializer.

  1 <script lang="ts" setup>
                            
  2 import { IconList } from '@iconify-prerendered/vue-bi'
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 13 })
    ~~
 14 </script>

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Sep 22, 2022

@cawa-93 it should be a different problem, if you still have this problem with v.0.40.13 or newer, please open an new issue and provide repro case.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Sep 22, 2022
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

No branches or pull requests

6 participants