<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Context</h2>
<p dir="auto">We export a Next.js site using <code class="notranslate">next export</code> and deploy it to Netlify. We noticed that after deploying a new version of the site, all users who have the previous version open in the browser cannot follow links anymore.</p>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">The router's <code class="notranslate">onAppUpdated</code> event is triggered and causes a reload of the page by default, as documented in the README.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto"><code class="notranslate">onRouteChangeStart</code> is triggered, but <code class="notranslate">onAppUpdated</code> (or even <code class="notranslate">onRouteChangeError</code>) is never called. Instead, nothing user-visible happens. The browser developer tools reveal a failed <code class="notranslate">&lt;script&gt;</code> request (because the build ID - and thus the JS chunk's path - changed) which is apparently not being acted upon.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Create a Next.js page with at least one (non-prefetch) link and create a listener for <code class="notranslate">onAppUpdated</code>.</li>
<li>Build it with <code class="notranslate">next export</code>, serve it (e.g. <code class="notranslate">npx server _build</code>) and visit it.</li>
<li>With the page open, rebuild the page (another <code class="notranslate">next export</code>).</li>
<li>Try clicking on the link you created. Nothing happens, and the <code class="notranslate">onAppUpdated</code> listener is not called.</li>
</ol>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.2.1</td>
</tr>
<tr>
<td>node</td>
<td>9.3.0</td>
</tr>
<tr>
<td>OS</td>
<td>macOS 10.13.1</td>
</tr>
<tr>
<td>browser</td>
<td>Any</td>
</tr>
</tbody>
</table>
<p dir="auto">I’m trying to render a nextjs page blob (from a HTTP POST) into an iframe src.</p>
<p dir="auto">I do a HTTP POST to an url in my next server. Then convert that html document into a blob using <code class="notranslate">const urlBlob = URL.createObjectURL(blob)</code> and passing that into an iframe <code class="notranslate">&lt;iframe src={urlBlob}/&gt;</code></p>
<p dir="auto">I had to use <strong>assetPrefix</strong> in <strong>next.config.js</strong> to point to the host, in this case <code class="notranslate">http://localhost:3000</code></p>
<p dir="auto">In npm run dev the hmr is unavailable.<br>
After running <code class="notranslate">npm build</code> and <code class="notranslate">npm start</code> it renders the page on an iframe and the JS loads.</p>
<p dir="auto">The problem is that the router is breaking my JS.</p>


<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">Javascript should be functional. I expect the router to be disabled.</p>
<h2 dir="auto">Current Behavior</h2>


<p dir="auto">Javascript crashes with the following error:</p>
<p dir="auto"><code class="notranslate">app.js:15 Failed to execute 'replaceState' on 'History': A history state object with URL 'tp://localhost:3000/2ada9931-0621-4f74-81ed-dc8255a340e6' cannot be created in a document with origin 'http://localhost:3000' and URL 'blob:http://localhost:3000/2ada9931-0621-4f74-81ed-dc8255a340e6'.</code></p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>HTTP Post to a NextJS page</li>
<li>Render the html blob into an iframe using Url.createObjectURL</li>
<li>Open browser's console and see the router errors.</li>
</ol>
<h2 dir="auto">Context</h2>


<p dir="auto">I am unable to use JS on iframes which are populated by blobs.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.1.0</td>
</tr>
<tr>
<td>node</td>
<td>8.8.1</td>
</tr>
<tr>
<td>OS</td>
<td>OSX High Sierra</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome 62</td>
</tr>
<tr>
<td>etc</td>
<td>...</td>
</tr>
</tbody>
</table>