Check where window is used in your code or third-party libraries and guard it so it's only accessed on the client side.
//Wrong: causes error during build
const width = window.innerWidth;
//Right: guard with typeof check
if (typeof window !== 'undefined') {
const width = window.innerWidth;
}