title: PouchDB replication fails after a while with error "Unexpected token < in JSON at position 0"
body: <p>I am trying to replicate a remote CouchDB database with PouchDB. Here is the replication call</p>
  <pre><code>try {
          await PouchDB.replicate(sourceDB, targetDB);
          console.log(`Replication complete!`);
      } catch (err) {
          console.error(`Replication failed with error ${err}`);
          throw err;
      }
  </code></pre>
  <p>The database (<code>sourceDB</code>) is quite large (around 8.2k docs and 28k deleted docs, for a total of 16.6MB).</p>
  <p>When calling the above, the replication always fails after around 10.4MB of data have been copied to <code>targetDB</code>.</p>
  <p>The exception says:</p>
  <blockquote>
  <p>Replication failed with error {&quot;name&quot;:&quot;Error&quot;,&quot;message&quot;:&quot;invalid json
  response body at http://my-db-url/_bulk_docs reason: Unexpected token
  &lt; in JSON at position 0&quot;}</p>
  </blockquote>
  <p>I am using PouchDB 7.2.2 and CouchDB 3.1.0</p>