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

TypeScript: changeTheme is not declared #4118

Closed
robertmorgan opened this issue Jul 10, 2023 · 0 comments
Closed

TypeScript: changeTheme is not declared #4118

robertmorgan opened this issue Jul 10, 2023 · 0 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@robertmorgan
Copy link
Contributor

Describe the bug

If your project uses TypeScript, and you're following the guide on how to switch themes, then TypeScript will complain that:

Property 'changeTheme' does not exist on type '{ config: PrimeVueConfiguration; }'

The function exists in JavaScript, it's just not declared properly for TypeScript.

Another bug references this issue, however it's probably not getting the attention due to the bug report's title remaining as the template default.

Reproducer

https://codesandbox.io/s/objective-matsumoto-znzm79?file=/src/App.vue

PrimeVue version

3.29.2

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. Follow the guide on how to switch themes from the PrimeVue site.
  2. Ensure that your script block has the lang="ts" attribute so that it is using TypeScript
  3. Observe the TS error in your IDE / run your TypeScript compatible build process to get the same error thrown.

Expected behavior

changeTheme should be present on the exported module signature for PrimeVue, alongside config.

@robertmorgan robertmorgan added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 10, 2023
@mertsincan mertsincan added this to the 3.30.1 milestone Jul 10, 2023
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants