useToast not working with typescript

UI Components for Vue
Post Reply
bernabei
Posts: 1
Joined: 19 Oct 2020, 18:19

01 Nov 2020, 02:32

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'..."

colasin16
Posts: 1
Joined: 05 Nov 2020, 23:17

05 Nov 2020, 23:27

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({...})
.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

12 Nov 2020, 10:32

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,

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests