Page 1 of 1

useToast not working with typescript

Posted: 01 Nov 2020, 02:32
by bernabei
Using typescript and composition api approach... The useToast function is not usable because the declaration file is missing (I think).
Adding the import statement as explained in documentation raise following error:
"Could not find a declaration file for module 'primevue/useToast'..."

Re: useToast not working with typescript

Posted: 05 Nov 2020, 23:27
by colasin16
This is my first time writing in a forum, sorry if my explanation is not very clear.

I have the same problem (although I'm not using typescript). I'm trying to use the Composition API exactly how they show in the documentation (https://primefaces.org/primevue/showcase/#/toast) and I get this error:

Code: Select all

This dependency was not found: * primevue/useToast in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./src/views/Upload.vue?vue&type=script&lang=js
I tried the Options API and it works using

Code: Select all

this.$toast.add({...})
.

Re: useToast not working with typescript

Posted: 12 Nov 2020, 10:32
by mert.sincan
Hi,

Thanks a lot for the report! We'll check and get back to you.
This is my first time writing in a forum, sorry if my explanation is not very clear.
- No problem, you can be comfortable in this forum ;)

Best Regards,