title: GatsbyJS - build show error window is not defined (AOS)
body: <p>I'm new with GatsbyJS and ReactJS and i have a problem when I build my project.
  The problem is whenever I build the project with AOS inside it, it show error window is not defined. It is totally fine when i run in develop mode.</p>
  
  <p><a href="https://i.stack.imgur.com/43lnU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/43lnU.png" alt="enter image description here"></a></p>
  
  <p>And this is my code:</p>
  
  <p><a href="https://i.stack.imgur.com/bAz78.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bAz78.png" alt="enter image description here"></a></p>
  
  <p>I read that componentDidMount() should fix the problem. Unfortunately, it does not work for me.</p>
  
  <p>Any help? Thank you..</p>