<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>
<p dir="auto">Hi, I'm trying to make my app in production on Google App Engine but this error occur :<br>
<code class="notranslate">Uncaught TypeError: Cannot read property 'forEach' of undefined</code></p>
<p dir="auto">When I check where the problem is I find :<br>
<code class="notranslate">window.__NEXT_LOADED_CHUNKS__.forEach</code></p>
<p dir="auto">Everything is ok on dev.<br>
You can check the live app here : <a href="https://www.chefing.fr" rel="nofollow">https://www.chefing.fr</a></p>
<p dir="auto">Here is my Dockerfile:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="FROM node:6.5 

RUN mkdir -p /app 
WORKDIR /app

ADD package.json /app/

COPY . /app/

RUN npm i
RUN npm i -g nodemon
RUN npm i -g next
RUN npm i -g react
RUN npm i -g react-dom

RUN next build
RUN echo $GAE_VERSION &gt; .next/BUILD_ID

ENV NODE_ENV=production

EXPOSE 3000
EXPOSE 8080

CMD [ &quot;npm&quot;, &quot;run&quot;, &quot;start&quot; ]"><pre class="notranslate"><code class="notranslate">FROM node:6.5 

RUN mkdir -p /app 
WORKDIR /app

ADD package.json /app/

COPY . /app/

RUN npm i
RUN npm i -g nodemon
RUN npm i -g next
RUN npm i -g react
RUN npm i -g react-dom

RUN next build
RUN echo $GAE_VERSION &gt; .next/BUILD_ID

ENV NODE_ENV=production

EXPOSE 3000
EXPOSE 8080

CMD [ "npm", "run", "start" ]
</code></pre></div>
<p dir="auto">Everything is ok with the deployement, push / pull, deployement, start etc... No error.<br>
And this is my next.config.js file (In case of problem).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="module.exports = {
  webpack: function (c) {
    if (c.resolve.alias) {
      delete c.resolve.alias['react']
      delete c.resolve.alias['react-dom']
    }
    return c
  }
}"><pre class="notranslate"><code class="notranslate">module.exports = {
  webpack: function (c) {
    if (c.resolve.alias) {
      delete c.resolve.alias['react']
      delete c.resolve.alias['react-dom']
    }
    return c
  }
}
</code></pre></div>
<p dir="auto">I hope you can help us :)<br>
Thanks, Steve.</p>
<p dir="auto">|---------|---------|<br>
| next    |   2.4.7 |<br>
| node    |     6.5 |<br>
| mobX    |     3.2 |</p>
<p dir="auto">this is server.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
const defaultHandlerWrapper = (app) =&gt; {
  const handler = app.getRequestHandler();
  return ({ raw, url }, hapiReply) =&gt; {
    return handler(raw.req, raw.res, url) // at this point filter raq,
      .then(() =&gt; {
        hapiReply.close(false);
      });
  };
};
"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">defaultHandlerWrapper</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">handler</span> <span class="pl-c1">=</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">getRequestHandler</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> raw<span class="pl-kos">,</span> url <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">hapiReply</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-s1">handler</span><span class="pl-kos">(</span><span class="pl-s1">raw</span><span class="pl-kos">.</span><span class="pl-c1">req</span><span class="pl-kos">,</span> <span class="pl-s1">raw</span><span class="pl-kos">.</span><span class="pl-c1">res</span><span class="pl-kos">,</span> <span class="pl-s1">url</span><span class="pl-kos">)</span> <span class="pl-c">// at this point filter raq,</span>
      <span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-s1">hapiReply</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>


<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>


<h2 dir="auto">Current Behavior</h2>


<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
<h2 dir="auto">Context</h2>


<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></td>
</tr>
<tr>
<td>node</td>
<td></td>
</tr>
<tr>
<td>OS</td>
<td></td>
</tr>
<tr>
<td>browser</td>
<td></td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>