NextJS: ReferenceError: document is not defined