<p dir="auto">I'm having issues building the <a href="https://github.com/cssivision/qrcode-react"><code class="notranslate">qrcode-react</code></a> library with <code class="notranslate">next build</code>. I get the following error:</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">The project should build.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">The project does not build. Run <code class="notranslate">npm run dev</code> and it will run in development. Run <code class="notranslate">npm run build</code> and it fails to build for production with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ Error: commons.js from UglifyJs
Unexpected token: name (QRCode) [commons.js:9424,6]
    at /Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/next/dist/server/build/index.js:183:21
    at emitRecords.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:354:15)
  errors: 
   [ 'commons.js from UglifyJs\nUnexpected token: name (QRCode) [commons.js:9424,6]' ],
  warnings: [] }"><pre class="notranslate"><code class="notranslate">{ Error: commons.js from UglifyJs
Unexpected token: name (QRCode) [commons.js:9424,6]
    at /Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/next/dist/server/build/index.js:183:21
    at emitRecords.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:365:9)
    at require.forEach.err (/Users/joncursi/Sites/joncursi/next-uglify-error/node_modules/webpack/lib/Compiler.js:354:15)
  errors: 
   [ 'commons.js from UglifyJs\nUnexpected token: name (QRCode) [commons.js:9424,6]' ],
  warnings: [] }
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Clone the reproduction repo: <a href="https://github.com/joncursi/next-uglify-error">https://github.com/joncursi/next-uglify-error</a></li>
<li><code class="notranslate">npm install</code></li>
<li><code class="notranslate">npm run build</code></li>
<li>You'll see the error.</li>
</ol>
<p dir="auto"><code class="notranslate">next@4.2.2</code></p>