timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.47k stars 310 forks source link

Icons not showing in remix in production #304

Open ringuralte opened 10 months ago

ringuralte commented 10 months ago

The toast icons like success and error won't show in production when using react-hot-toast with remix. This is how i initiated it in root.tsx

` return (

)`

lime517 commented 10 months ago

Strange - I have the same issue in that the icons don't show. I get a spinner icon instead, but it isn't spinning.

I also have a Remix application, and am only seeing the issue in production.

ringuralte commented 10 months ago

@lime517 yeah it's the same problem for me as well, it works in local development but production have a spinning icon instead which isn't spinning.

tb-b commented 9 months ago

Same here. Showing static spinner on Remix.

tb-b commented 9 months ago

This has fixed it for me, though it relies on remix-utils

import { ClientOnly } from "remix-utils/client-only";

<ClientOnly>
    {() => (
        <Toaster //
           ...
        />
    )}
</ClientOnly>
lime517 commented 7 months ago

@tb-b - is that fix still working for you? I gave it a shot, and while it improved the situation, I often still get icons that aren't loading.

ringuralte commented 7 months ago

Setting customs icons seem to fix the issue for me.

stuart-so commented 4 months ago

I am still getting this issue. Icons show a loading circle instead. Happens on success and error. Did anyone find a stable solution?

toast_no_icon

lime517 commented 4 months ago

@stuart-so - our team just uses custom icons. I never found a stable solution for the stock icons with Remix. I've also been looking at https://ui.shadcn.com/docs/components/sonner as a potential alternative.