ReferenceError: Window is not defined when using NextJS

Hi there,
I just try again to setup OpenReplay with Next.js (version 14 - latest), and it breaks on my site, here’re my steps:
• Just init Next.js application, deployed to Vercel successfully
• Then create <TrackerProvider/> following the tutorial

Here’s the error throw when add <TrackerProvider/> to Next.js app, there’re no other action/context.

Could you and team help to take a look and review the tutorial?

TrackerProvider should be client component, but seems like you are using as a server component. This looks very much similar to this error.

Also next.js does render its page once without window , so you can omit the tracker when window is undefined:
if (typeof window === "undefined")