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

With Typescript shims not working for: this.$dialog, this.$confirm, this.$toast #6624

Closed
Burtsev-Alexey opened this issue Oct 22, 2024 · 6 comments
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback

Comments

@Burtsev-Alexey
Copy link

Burtsev-Alexey commented Oct 22, 2024

Shims are declared in module 'vue' doesnt work with options API, I changed it to be module '@vue/runtime-core' - and it works.
image

Reproducer

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

PrimeVue version

4.1.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@Burtsev-Alexey Burtsev-Alexey added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 22, 2024
@mertsincan
Copy link
Member

Interesting! Please see this issue; #6199

@sceee Could you please check this issue?

@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 23, 2024
@sceee
Copy link
Contributor

sceee commented Oct 23, 2024

@Burtsev-Alexey I cannot see in your reproducer what is not working.
Also, your reproducer is using an older primevue version (4.0.0-rc.3), please update it first to use the latest version.
Could you then please explain the steps you did to reproduce it?
The Shims should only affect the typescript compile, not runtime.

FYI @mertsincan

@Burtsev-Alexey
Copy link
Author

Burtsev-Alexey commented Oct 23, 2024

@sceee

The Shims should only affect the typescript compile, not runtime.

Yes, it effects only compilation errors.

Also, your reproducer is using an older primevue version (4.0.0-rc.3), please update it first to use the latest version.

I have used the one that was provided in link when I was creating an issue. I have not realized I need to change version...

I cannot see in your reproducer what is not working.

Because StackBlitz doesnt show syntax (compilation) errors... You need to open project in IDE (I use VSCode)

This is how it looks without fix:
image

This is how it looks with fix:
image

@sceee
Copy link
Contributor

sceee commented Oct 23, 2024

Hi @Burtsev-Alexey , I've updated your reproducer to primevue 4.1.1 (and removed the StepperPanel import which is no longer exported) and ran npm run build (which you can also do in stackblitz) - no issues are displayed:
https://stackblitz.com/edit/primevue-4-ts-vite-issue-template-baezk4?file=package.json

image

According to your screenshots it looks like you are using a different project locally - as the affected component is called Foo.vue.
Probably you have other libraries installed that incorrectly augment vue types creating that issue? See #6199 for details.

@Burtsev-Alexey
Copy link
Author

Probably you have other libraries installed that incorrectly augment vue types creating that issue? See #6199 for details.

@sceee This could be the case, Thank you I will try now with clean reproducer and come back with result

@Burtsev-Alexey
Copy link
Author

@sceee You are right, I found the "evil", it was https://github.com/imcvampire/vue-axios dependency that is "cleaning up" ComponentCustomProperties

Sorry for inconvenience, issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
None yet
Development

No branches or pull requests

3 participants