It looks like the instance.cached_options object is empty on global toasts.
For the moment I just modified the if in _goAway to check if position is defined and avoid the error:
if (instance.cached_options.position && instance.cached_options.position.includes('bottom')) {
This is the definition of the global toast done in main.js right after setting up Toasted.
Vue.use(Toasted, {
position: 'top-right',
duration: 5000,
theme: 'primary'
})
Vue.toasted.register('cookieNotification',
(thisVue) => {
// Use thisVue instance to resolve some routes in here
var toastContent = 'some notification content'
return toastContent
},
{type: 'info',
position: 'bottom-right',
duration: null,
className: 'cookie-alert',
onComplete: function () {
var d = new Date()
d.setTime(d.getTime() + (14 * 24 * 60 * 60 * 1000))
var expires = 'expires=' + d.toUTCString()
document.cookie = 'cookieNotice=true;' + expires + ';path=/'
},
action: {
text: 'X',
onClick: (e, toastObject) => {
var d = new Date()
d.setTime(d.getTime() + (14 * 24 * 60 * 60 * 1000))
var expires = 'expires=' + d.toUTCString()
document.cookie = 'cookieNotice=true;' + expires + ';path=/'
toastObject.goAway(0) //This is where the issue occurs
}
}
}
)
It looks like the instance.cached_options object is empty on global toasts.
For the moment I just modified the if in _goAway to check if position is defined and avoid the error:
if (instance.cached_options.position && instance.cached_options.position.includes('bottom')) {
This is the definition of the global toast done in main.js right after setting up Toasted.