When using server side rendering frameworks such as Next.js, the watchRTC SDK gets integrated and built on a server platform instead of inside the browser itself. This may lead to execution errors once you import and include the watchRTC SDK.
You may bump into something like this error message:
How to avoid this error message?
To avoid this error message, you just need load our watchRTC SDK
dynamically:
useEffect(() => {
async function initWRTC() {
const watchrtc = await import("@testrtc/watchrtc-sdk");
watchrtc.init({...});
}
initWRTC();
});