Unable to use Vapi in Next.js
I have a Next.js app using the app directory, and I'm already converting the file that vapi is being instanciated in to a client file.
But, when i emit an event from vapi, e.g vapo.on("call-start" , fn), i get this error:
How do i fix this? plz.
But, when i emit an event from vapi, e.g vapo.on("call-start" , fn), i get this error:
TypeError: Cannot read properties of undefined (reading 'ondevicechange')
Call Stack
Qh
node_modules/.pnpm/@daily-co+daily-js@0.57.4/node_modules/@daily-co/daily-js/dist/daily-esm.js (7:109991)How do i fix this? plz.