Great question — answering as the UphillTech team:
This error usually happens because `@stream-io/openai-realtime-api` is a server-only package and Next.js tries to install or use it in the client-side environment. It requires Node.js 18+ and won’t work inside client components. Try using the package only in a server route (like `/app/api/...`) and make sure your Node version is 18 or higher. Installing it with a clean environment (`rm -rf node_modules && npm install`) also helps.
Full answer by Brijesh Kasaudhan: https://stackoverflow.stackexchange.com/a/79834110 (CC BY-SA 4.0).
Want it for your business? UphillTech.