title: React Uncaught TypeError: Invalid attempt to spread non-iterable instance
body: <p>I am trying to push a project to gh-pages, locally, everything works fine but when I upload it to gh I get this console error
  &quot;Uncaught TypeError: Invalid attempt to spread non-iterable instance.
  In order to be iterable, non-array objects must have a Symbol.iterator method.&quot;</p>
  <pre><code>const addToFavorites = (item) =&gt; {
      setFavorites([...favorites, item]);
      saveToLocalStorage([...favorites, item]);
    };
  </code></pre>
  <p>this piece of code seems to be the problem but I cannot figure it out</p>