<p dir="auto">Hi,</p>
<p dir="auto">Looks like a basic next.js project gets react duplicated in the <code class="notranslate">next-dev.bundle.js</code>.<br>
when launching my fresh project, and going to <a href="http://127.0.0.1:3000/_next/next-dev.bundle.js" rel="nofollow">http://127.0.0.1:3000/_next/next-dev.bundle.js</a> i can see two <code class="notranslate">SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED</code> in the source, and i guess this is not good ?</p>
<p dir="auto">it doesnt hurt for simple cases, but as soon as you use <code class="notranslate">ReactCSSTransitionGroup</code> or something using React <code class="notranslate">refs</code> then you get that error :</p>
<blockquote>
<p dir="auto">next-dev.bundle.js:945 Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's <code class="notranslate">render</code> method, or you have multiple copies of React loaded (details: <a href="https://fb.me/react-refs-must-have-owner).(%E2%80%A6" rel="nofollow">https://fb.me/react-refs-must-have-owner).(…</a>)</p>
</blockquote>
<p dir="auto">PS: using next.js@1.2.3</p>
<p dir="auto">While trying to enable the Node inspector via the <code class="notranslate">--inspect</code> flag, it was noticed that it only works if is used in its default form. None of its other forms work, i.e: <code class="notranslate">--inspect=0.0.0.0:9928</code></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?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Node-related flags should be passed through as-is.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">The code in the <code class="notranslate">bin/next</code> file (lines 35-37) is only looking for the <code class="notranslate">--inspect</code> flag, but none of its other forms. A recommended solution is to define an array of Node flags, look them up in the <code class="notranslate">next</code> arguments, and pass them as-is to the Node runtime.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Run <code class="notranslate">next --inspect=0.0.0.0:9229</code></li>
<li>The server starts without a debugger endpoint.</li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">This issue affects when deploying the app to a local docker container or a Kubernetes pod since the debugger IP must be set to 0.0.0.0, or else it won't be exposed in the container/pod. Currently, there's no way to setup debugging in a container/pod.</p>
<h2 dir="auto">Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>latest</td>
</tr>
<tr>
<td>node</td>
<td>8.9.3</td>
</tr>
<tr>
<td>OS</td>
<td>MacOS</td>
</tr>
</tbody>
</table>