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

After updating PrimeVue 4.1.1, typescript errors began to occur #6791

Open
SchwarzesWasser opened this issue Nov 15, 2024 · 0 comments
Open
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@SchwarzesWasser
Copy link

Describe the bug

Since version 4.1.1, many TS errors have appeared in my project. The example from stackblitz does not output type errors when executing the npm run type-check command. But there are a lot of errors in the IDE, for example:

src/components/form/LocalSelect/LocalSelect.vue:260:40 - error TS2339: Property '$el' does not exist on type '{ $props: SelectProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; $slots: SelectSlots; $emit: ((e: "filter", event: SelectFilterEvent) => void) & ... 7 more ... & ((e: "change", event: SelectChangeEvent) => void); }'.

const tempRef = localSelectRef.value.$el.querySelector('.p-multiselect-label-container');


src/components/form/LocalSelect/LocalSelect.vue:266:35 - error TS2339: Property 'overlayVisible' does not exist on type '{ $props: SelectProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; $slots: SelectSlots; $emit: ((e: "filter", event: SelectFilterEvent) => void) & ... 7 more ... & ((e: "change", event: SelectChangeEvent) => void); }'.

watch(() => localSelectRef.value?.overlayVisible, (newValue) => {

src/components/form/LocalSelect/LocalSelect.vue:275:70 - error TS2339: Property '$el' does not exist on type '{ $props: SelectProps & VNodeProps & AllowedComponentProps & ComponentCustomProps; $slots: SelectSlots; $emit: ((e: "filter", event: SelectFilterEvent) => void) & ... 7 more ... & ((e: "change", event: SelectChangeEvent) => void); }'.

if (props.isFilter && localSelectRef.value && !localSelectRef.value.$el.contains(event.target)) {

And there are quite a lot of such errors in different PrimeVue controls. For example, upload() and choose() methods no longer exist in the FileUpload component in template ref. Vue: Property upload does not exist on type.

Could there be a problem updating the definition of controls? Everything worked fine before version 4.1.1

image

Is this a PrimeVue bug or should I work with types in some other way?

Reproducer

https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-23calj?file=src%2FApp.vue

PrimeVue version

4.1.1

Vue version

4.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@SchwarzesWasser SchwarzesWasser added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant