NuxtN
Nuxt4mo ago
5 replies
Goromi

useToast and useOverlay not working on prod, working fine on dev

So I've been struggling with nuxt ui for the past few days, I use the useToast and useOverlay composables and everything works fine on dev mode, but once I deploy my project they just wont do anything and I have no idea why. I tried both ssr and ssg mode but it doesn't work. I don't understand what I'm doing wrong here.

I installed nuxt UI 4.0.0 that just came out, but that didn't change anything

For instance one of my useToast is used in a pinia store :

    const addNpc = (npc: NPC) => {

        npcHistory.value.push(npc);
        
        const toast = useToast();

        const toastTitle = `${npc.name} added to history`;

        toast.add({title: toastTitle})
    }


And my app.vue is :

<template>

  <UApp>
    <NuxtLayout>
      <NuxtPage />
    </NuxtLayout>
  </UApp>

</template>
Was this page helpful?