Next.js Discord

Discord Forum

Nextjs SSE works in local but not when deployed to vercel

Unanswered
Red imported fire ant posted this in #help-forum
Open in Discord
Red imported fire antOP
After some time checking through this it seems like when I deploy to vercel the SSE response headers don't have a keep-alive connection, which I'm not sure why it's happening.

1 Reply

@Red imported fire ant After some time checking through this it seems like when I deploy to vercel the SSE response headers don't have a keep-alive connection, which I'm not sure why it's happening.
vercel is a serverless platform, so it's fundamentally impossible to deploy SSE in there. you can deploy an endpoint that sends a stream, but you can't deploy SSE or websocket which requires a long-running server.

if you need SSE/websocket, you must get a server that runs 24/7.