I am new to vercel and I am trying to deploy an application which consist of chat feature. I am using ably.com as pub/sub chat feature. I am trying to use ably realtime for both publishing and subscribing the event but somehow the publish event in API throws an error. I checked the documentation and I coded it correctly.
The same code is working perfectly fine on localhost but as soon as I deploy that to vercel then it does not work and throw error.
I am using following code to publish the message from API.
var realtime = new Ably.Realtime('<Ably key>');
var channel = realtime.channels.get('ham-gym-tag');
channel.publish('example', 'message data');