Кеняка
Кеняка2mo ago

Sonner toast promise error

I don’t know if this error is related to convex or not, but I’ll ask just in case. In my project I use the Sonner library for toast and when I call the promise function *(so that toast depends on the result of loading/success/error) *on the local one it produces everything correctly, but when deployed to netlify it always produces only an error I attached a video where I do the same actions on localhost and netlify example of my use
const archive = useMutation(api.document.archive)
const promise = archive({
id,
userId: orgId
})

toast.promise(promise, {
loading: "Перемещаем в архив...",
success: "Заметка перемещена в архив!",
error: "Не удалось переместить в архив"
})
const archive = useMutation(api.document.archive)
const promise = archive({
id,
userId: orgId
})

toast.promise(promise, {
loading: "Перемещаем в архив...",
success: "Заметка перемещена в архив!",
error: "Не удалось переместить в архив"
})
Emil Kowalski
Sonner
An opinionated toast component for React.
1 Reply
ballingt
ballingt2mo ago
@Кеняка when you look at the Convex dashboard logs, are these Convex mutations failling in prod and succeeding locally? Or are the mutations always succeeding in the prod and local dashboards, but just the toast behaving differently? Do you have logic that tries to read an error message from the mutation to use in Sonner toast?

Did you find this page helpful?