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
const{ inject, provide }=require("@vue/composition-api");consttoastSymbol=Symbol("Vue Toastification");/** @type {ReturnType<typeof createToastInterface>} */constinjectDefault={};letcreateToastInterface=(options)=>{console.warn("[Vue Toastification] This plugin does not support SSR!")return{}}if(typeofwindow!=='undefined'){consttoastification=require("vue-toastification");createToastInterface=toastification.createToastInterface}// Generate provider and consumerconstprovideToast=options=>provide(toastSymbol,createToastInterface(options));constuseToast=()=>inject(toastSymbol,injectDefault);module.exports={ provideToast, useToast };
The text was updated successfully, but these errors were encountered:
Versions
Describe the bug
The plugin may be used by applications running with SSR. This causes everything to break.
vue-toastification/composition/index.js
must be changed so it:useToast
andprovideToast
with dummy functions that do nothing on the serverExpected behavior
When using composition functions with frameworks like Nuxt, Vue toastification should not break the application.
Steps to reproduce
Use Nuxt with SSR and add the line
Fix suggestion
Possible fix:
The text was updated successfully, but these errors were encountered: