OpenCut icon indicating copy to clipboard operation
OpenCut copied to clipboard

[BUG] Toasts aren't working

Open Sivayogeith opened this issue 1 year ago • 5 comments

Platform

Mac OS 15.5

Browser

Brave 1.79.126

Current Behavior

After joining the waitlist, the toast doesn't show up even though the request to API succeeded. This also happens to all the places toast() has been used.

Expected Behavior

The toast should show up when the toast() function is called.

Recurrence Probability

Always

Steps To Reproduce

  1. Enter a valid email in the input.
  2. Click Join waitlist

Anything else?

There are no errors in the console and I have tested this in local (using toast() outside all the if's).

Sivayogeith avatar Jul 14 '25 09:07 Sivayogeith

Adding <Toaster /> to hero.tsx works, but obviously that's not a solution.

Sivayogeith avatar Jul 14 '25 09:07 Sivayogeith

In my case, I just added the component in the layout.tsx file. This allows you to use toast.info("Your message") in any component that is a child of layout.tsx.

steve-bang avatar Jul 14 '25 09:07 steve-bang

Fixed the problem by changing

import { Toaster } from "../components/ui/sonner";

in layout.tsx to

import { Toaster } from "../components/ui/toaster";

Sivayogeith avatar Jul 14 '25 10:07 Sivayogeith

uh @mazeincoding should i close this? i mean is it fixed?

Sivayogeith avatar Jul 15 '25 02:07 Sivayogeith

oh yes it's fixed!

mazeincoding avatar Jul 15 '25 10:07 mazeincoding