So I'm learning NextJs and trying to build a audio chat app and I'm stuck when I try to import PeerJs
Its throwing an window is not defined error.
import Peer from 'peerjs';
export default function Home() {
useEffect(() => {
const myPeer = new Peer(undefined, {
host: '/',
port: '3001'
})
}, [])
}