-
Summaryhttps://nextchatter.vercel.app/ This is the link of the deployed app. In development on my local machine everything is working fine but when I deploy it on Vercel, the messages and notifications are not working until I refresh the page or send another message. (requests are delayed by one request) This is the link to my repository: Additional informationNo response Example |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 18 replies
-
I am also encountering this issue, after deploying to Vercel, all the pusher events seems to be delayed by one request. |
Beta Was this translation helpful? Give feedback.
-
I also had this issue and the solution for me was awaiting the pusher trigger function. I think that since vercel once you send the response to the client closes the serverless function, the pusher event doesn't have time to be sent |
Beta Was this translation helpful? Give feedback.
-
It's also worth remembering that Vercel will cache your |
Beta Was this translation helpful? Give feedback.
-
@manuelffernandez You are right - thank you for your answer you helped to solve this issue - https://streamable.com/dze31q Update: ok sometimes it doesn't fix this https://streamable.com/dze31q (I added router.refresh() on DesktopSidebarTicekt click - still the same) Update 2: I fixed it in production - so your function to open some chat/ticket should look like this function openTicket(ticketId: string) {
resetUnreadMessages(ticketId)
setTimeout(() => {
router.refresh()
}, 250)
} I added timeout and it fiexs issue shown here https://streamable.com/dze31q Possible fix 1: add
|
Beta Was this translation helpful? Give feedback.
Sure, i changed
to
This way the serverless function does not end before pusher has sent the message