Nuxt PrimeVue Toast component doesn't work correctly without autoImport: true? #2781
Unanswered
sparrow-chik-chrk
asked this question in
PrimeVue
Replies: 1 comment 1 reply
-
Hello @sparrow-chik-chrk. There'a an open issue with nuxt auto import logic. It seems like it is actually inverted. Check here: primefaces/primevue#6187 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using the @primevue/nuxt-module, the Toast component does not work correctly unless autoImport: true is enabled.
The component is successfully added to the page, and TypeScript recognizes
useToast()
.However, when calling
useToast().add("Example")
, nothing happens.I verified that
ToastService
is automatically imported by the module, as attempting to manually add a plugin for it results in a console message indicating that it is already registered.And even if you manually add the service via a plugin, it still doesn't work.
For testing purposes, I set the components, directives, and composables options to include: "*", but the issue persisted.
However, when autoImport: true is enabled, everything works as expected, and useToast().add("Example") starts functioning properly.
It seems that the auto-import is handling something outside of the defined components, directives, and composables configurations, which is necessary for Toast to work.
Any ideas on how to solve this issue specifically for Nuxt?
The standard documentation doesn't cover this case, and all the issues I've read suggest the same thing, often not considering
@primevue/nuxt-module
.I already created an issue, but it was just closed without anyone looking into the matter.
Beta Was this translation helpful? Give feedback.
All reactions