I have such a problem when I launch storybook, this error appears in my localhost:6006 and I no longer know how to fix it
I have a problem when start storybook

I can't figure out what the error is
stories.jsx
export default {
title: 'UI/Toast',
argTypes: {
toastType: {
control: {
type: 'select',
options: [
...
],
},
},
...
},
}
const Template = (args) => {
toast.showToast(
args.description,
args.backgroundColor,
args.padding,
{
type: args.toastType,
position: args.toastPosition,
autoDelete: args.toastIsAutoDelete,
delay: args.toastAutoDeleteTime,
animation: args.animation,
},
)
}
export const Default = Template.bind({})
Default.args = {
...
}
I use the singletone pattern to create notifications
toastCreator.js
let toastList = []
class ToastCreator {
constructor(toastList) {
if (ToastCreator.singleton) {
return ToastCreator.singleton
}
ToastCreator.singleton = this
this.toastList = toastList
}
getId() {
return uuidv4()
}
getProp(text, padding, prop, backcolor) {
const { toastId, type } = prop
const [icon, backgroundColor, title, color] =
getToastPropertiesByType(type)
return {
...prop,
id: toastId || this.getId(),
description: text || 'Description',
padding: padding || '',
title: title,
color: color,
backgroundColor: backcolor || backgroundColor,
icon: icon,
}
}
showToast(text, backgroundColor, padding, prop) {
const { position, autoDelete, delay, animation } = prop
if (toastList.length < 3) {
toastList = [
...toastList,
this.getProp(text, backgroundColor, padding, prop),
]
}
return (
<ToastPortal>
<ToastContainer
toastList={toastList}
position={position}
autoDelete={autoDelete}
autoDeleteTime={delay}
animation={animation}
padding={padding}
/>
</ToastPortal>
)
}
}
export const toast = new ToastCreator(toastList)
How I can fix this problem ?