Open netandreus opened 1 year ago
I've spent the last day trying to understand why my Toasts work in development but not production 😓 . This bug report led me to the answer... I had __VUE_OPTIONS_API__
explicitly false
in my prod webpack build. Changing to true
has my app Toast'ing again. Thank you!
Looks like the only place the options api is used is here: https://github.com/Maronato/vue-toastification/blob/b34ea31f76cb3204fcdd047c0214df77850afefa/src/components/VtToastContainer.vue#L215-L221
Every other component seems to only use <script setup>
tags (or no <script>
at all), I guess the snippet above could be safely removed?
Versions
2.0.0-rc.5
, andnext
version also.Describe the bug
I just installed this package like this:
main.ts
I use Pinia for state management. Somewhere in
./stores/AuthStore.ts
There is no toast shows at the page. In browser console there is this error:
Expected behavior
Toast is visible at the page.
Steps to reproduce
Install with this config files.
packages.json
webpack.config.js
Environment
I also try to use next version without success.
Cause
As lllopo mentioned in issue-305 while your plugin states it is for the composition API, it internally uses the options API for the components. So, setting
VUE_OPTIONS_API
to false in webpack actually breaks it. And it was my case.Temporary workaround
Set this
in webpack.config.js solves this issue, but It should be well documented in manual at least. It's a serous problem for all people trying to use this package with vue 3.