You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toast only shows the fist time the code compiles.
If you refresh the page without changing the code the toast does not show again.
If you change anything in the code and vite compiles again the toast shows once again but only one time.
Expected behavior
The toast should appear every time you refresh the page.
Steps to reproduce
Create vue 3 app and register vue-toastification.
Launch toast.info("something") in the created hook of the root component.
The toast only appears the first time you load the page.
Your Environment
Vue3+vite installation.
Trying with hmr es-builder
The text was updated successfully, but these errors were encountered:
I was having the same issue. It's not really a "fix", but a workaround is to put the toast call inside of a requestIdleCallBack() in your mounted (or onMounted if setup) hook. Should look something like this:
I was having the same issue. It's not really a "fix", but a workaround is to put the toast call inside of a requestIdleCallBack() in your mounted (or onMounted if setup) hook. Should look something like this:
Hey @john-landgrave , worked for me with requestIdleCallback (on chrome at least). Thank you !
(I used requestIdleCallback with a 'b' lowercase, you may want to update your comment).
Edit : After some tests, requestAnimationFrame also seams to work. Maybe a better alternative to requestIdleCallback who lacks Safari support ?
Versions
Describe the bug
Toast only shows the fist time the code compiles.
If you refresh the page without changing the code the toast does not show again.
If you change anything in the code and vite compiles again the toast shows once again but only one time.
Expected behavior
The toast should appear every time you refresh the page.
Steps to reproduce
Create vue 3 app and register vue-toastification.
Launch toast.info("something") in the created hook of the root component.
The toast only appears the first time you load the page.
Your Environment
Vue3+vite installation.
Trying with hmr es-builder
The text was updated successfully, but these errors were encountered: