title: Gatsby Failed Build - error "window" is not available during server side rendering
body: <p>I have been trying to build my gatsby (react) site recently using an external package.
  The link to this package is &quot;https://github.com/transitive-bullshit/react-particle-animation&quot;.</p>
  <p>As I only have the option to change the props from the components detail, I cannot read/write the package file where it all gets together in the end as it is not included in the public folder of 'gatsby-build'.</p>
  <p>What I have tried:</p>
  <ul>
  <li>Editing the package file locally, which worked only on my machine but when I push it to netlify, which just receives the public folder and the corresponding package.json files and not the 'node-modules folder', I cannot make netlify read the file that I myself changed, as it requests it directly from the github page.</li>
  </ul>
  <hr />
  <p>As a solution I found from a comment to this question, we can use the <a href="https://www.npmjs.com/package/patch-package" rel="noreferrer">&quot;Patch-Package&quot;</a> to save our fixes to the node module and then use it wherever we want.
  This actually worked for me!</p>
  <p>To explain how I fixed it: (As most of it is already written in the &quot;Patch Package DOCS), so mentioning the main points:</p>
  <ul>
  <li>I first made changes to my local package files that were giving the error.(For me they were in my node_modules folder)</li>
  <li>Then I used the Patch Package Documentation to guide my self through the rest.</li>
  <li>It worked after I pushed my changes to github such that now, Patch Package always gives me my edited version of the node_module.</li>
  </ul>