-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
No intellisense for props, slots etc. with v4 #5903
No intellisense for props, slots etc. with v4 #5903
Comments
Facing the same issue with Nuxt 3. |
Thanks a lot for your report! @Sector6759, is there a small sample project with your config to replicate it? |
@mertsincan I added a reproducer link in my original post. Don't forget to accept the prompt on StackBlitz when it asks to install the Vue - Official extension. |
Hi, I also have no Intellisense for props - only the documentation comments, with Typescript and without. Vite project, installed following Vite instructions, in styled mode. Should be pretty easy to repro, as I made the project yesterday - version 4.0.0-rc.2 |
Also encountering the same issue with Nuxt 3 |
Yep same issue in all editors I use |
@mertsincan What exactly is the 4.x milestone? There are a lot of issues which have been opened a "long" time ago. Also, there isn't a single closed issue related to this milestone. Is this merely for collecting issues that will eventually be moved to more specific milestones? |
I just have created a new test project at https://github.com/2234839/primevue-test |
replace |
@nawazishali @matt-sr @tomascf @Fischer96 @Proxx07 @2234839 I recently noticed that I wasn't importing PrimeVue components like intended. I always imported the PrimeVue components in my own components, like I did in the example picture, but the docs never say that we should do so. Instead they instruct us to register components, by using @mertsincan I'm not sure if this issue can be closed. I assume something's still off, because I don't expect intellisense to break only because of importing PrimeVue components inside my own components. |
Same issue here, would love to get back to primevue, but without intellisense the dev time will definitely increase |
@rogrile Did you even read my last comment? |
I'm using Nuxt (with a nuxt module for primevue). I have autoimports on, thus I do not import the components myself, nor do I use app.component() or app.use() for plugins. This does not work out of the box, and it does work with primevue 3 |
I see. I'd like to get an update on this from the PrimeVue team myself. My only guess is that they are busy fixing all kinds of things. |
I can resolve my case with workaround from @Sector6759 mentioned above. Thanks for the information. TLDR: If we've already imported primevue using the app.use in Even it might be handy, I am strongly not in favor of using a global registration. Not to mention code actions usually import the component to local imports as we type automatically. Hope we can hear back from PrimeVue team soon. |
@pwang2 Alternatively you can use auto imports. |
Thanks. Yes. I keep thinking about from a modular even with SFC. So, I am feeling sort of mixed when using something not imported. I could be wrong/stubborn here. as |
Here is a temporary fix that I did using the PrimeVue auto-import plugin
// components.d.ts
import { DefineComponent, GlobalComponentConstructor } from '@primevue/core';
type FixPrimeVue<T> =
T extends DefineComponent<infer Props, infer Slots, infer Emits, infer Methods>
? GlobalComponentConstructor<Props, Slots, Emits, Methods>
: T;
declare module 'vue' {
export interface GlobalComponents {
Button: FixPrimeVue<typeof import('primevue/button')['default']>
// Add the components you are using here
}
} Hopefully #6088 is merged soon which should fix this. |
@Skstud5 Are you sure you have set up WebStorm correctly? I just tried it in WebStorm and it does work. |
Yes, everything is set up. |
@Skstud5 Just follow this up-to-date Getting started tutorial which the PrimeVue team uploaded recently. If intellisense is not working in WebStorm for you, then there has to be something wrong with your setup. |
Describe the bug
In v4, it seems like some types are not defined correctly as I'm getting no Intellisense for props, slots etc.
I see that you used to extend
ClassComponent
before v4Now in v4 you use
DefineComponent
It seems like something is still missing somewhere in the type parameter chain.
Intellisense in v3
Intellisense in v4
Reproducer
StackBlitz
Edit: this reproducer now shows the desired behavior because I updated it according to my comment.
PrimeVue version
4
Vue version
3.x
Language
TypeScript
Build / Runtime
Vue CLI App
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: