<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"><code class="notranslate">import getConfig from 'next/config'</code> should work in accordance w/ readme</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Running <code class="notranslate">now</code> (and <code class="notranslate">next build</code>) produces the following build error</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; Failed to build
&gt; { Error: (client) ./config/env.ts
&gt; Module not found: Error: Can't resolve 'node_modules/next/config.js' in '/home/nowuser/src/config'
&gt; resolve 'node_modules/next/config.js' in '/home/nowuser/src/config'
&gt;   Parsed request is a module
&gt;   using description file: /home/nowuser/src/package.json (relative path: ./config)
&gt;     Field 'browser' doesn't contain a valid alias configuration
&gt;   after using description file: /home/nowuser/src/package.json (relative path: ./config)
&gt;     resolve as module
&gt;       looking for modules in /home/nowuser/src/node_modules/next/node_modules
&gt;         using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules)
&gt;           Field 'browser' doesn't contain a valid alias configuration
&gt;         after using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules)
&gt;           using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules/node_modules/next/config.js)
&gt;             no extension
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js doesn't exist
&gt;             .js
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.js doesn't exist
&gt;             .jsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.jsx doesn't exist
&gt;             .json
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.json doesn't exist
&gt;             .ts
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.ts doesn't exist
&gt;             .tsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.tsx doesn't exist
&gt;             as directory
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js doesn't exist
&gt;       /home/nowuser/src/config/node_modules doesn't exist or is not a directory
&gt;       /home/nowuser/node_modules doesn't exist or is not a directory
&gt;       /home/node_modules doesn't exist or is not a directory
&gt;       /node_modules doesn't exist or is not a directory
&gt;       looking for modules in /home/nowuser/src/node_modules
&gt;         using description file: /home/nowuser/src/package.json (relative path: ./node_modules)
&gt;           Field 'browser' doesn't contain a valid alias configuration
&gt;         after using description file: /home/nowuser/src/package.json (relative path: ./node_modules)
&gt;           using description file: /home/nowuser/src/package.json (relative path: ./node_modules/node_modules/next/config.js)
&gt;             no extension
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js doesn't exist
&gt;             .js
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.js doesn't exist
&gt;             .jsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.jsx doesn't exist
&gt;             .json
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.json doesn't exist
&gt;             .ts
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.ts doesn't exist
&gt;             .tsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.tsx doesn't exist
&gt;             as directory
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js doesn't exist
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.js]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.jsx]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.json]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.ts]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.tsx]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/config/node_modules]
&gt; [/home/nowuser/node_modules]
&gt; [/home/node_modules]
&gt; [/node_modules]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.js]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.jsx]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.json]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.ts]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.tsx]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js]
&gt;  @ ./config/env.ts 4:16-54
&gt;  @ ./config/index.ts
&gt;  @ ./pages-code/login/make-linkedin-url.ts
&gt;  @ ./pages/login.js
&gt;  @ multi ./pages/login.js
&gt;     at /home/nowuser/src/node_modules/next/dist/server/build/index.js:207:31
&gt;     at runWithDependencies (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:154:4)
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1126:9
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:473:16
&gt;     at iteratorCallback (/home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1050:13)
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:958:16
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1123:13
&gt;     at runCompilers (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:96:47)
&gt;     at fn (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:101:6)
&gt;     at compiler.run (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:150:5)
&gt;     at emitRecords.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:265:13)
&gt;     at Compiler.emitRecords (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:371:38)
&gt;     at emitAssets.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:258:10)
&gt;     at applyPluginsAsyncSeries1.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:364:12)
&gt;     at next (/home/nowuser/src/node_modules/tapable/lib/Tapable.js:218:11)
&gt;     at Compiler.compiler.plugin (/home/nowuser/src/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)"><pre class="notranslate"><code class="notranslate">&gt; Failed to build
&gt; { Error: (client) ./config/env.ts
&gt; Module not found: Error: Can't resolve 'node_modules/next/config.js' in '/home/nowuser/src/config'
&gt; resolve 'node_modules/next/config.js' in '/home/nowuser/src/config'
&gt;   Parsed request is a module
&gt;   using description file: /home/nowuser/src/package.json (relative path: ./config)
&gt;     Field 'browser' doesn't contain a valid alias configuration
&gt;   after using description file: /home/nowuser/src/package.json (relative path: ./config)
&gt;     resolve as module
&gt;       looking for modules in /home/nowuser/src/node_modules/next/node_modules
&gt;         using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules)
&gt;           Field 'browser' doesn't contain a valid alias configuration
&gt;         after using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules)
&gt;           using description file: /home/nowuser/src/node_modules/next/package.json (relative path: ./node_modules/node_modules/next/config.js)
&gt;             no extension
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js doesn't exist
&gt;             .js
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.js doesn't exist
&gt;             .jsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.jsx doesn't exist
&gt;             .json
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.json doesn't exist
&gt;             .ts
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.ts doesn't exist
&gt;             .tsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.tsx doesn't exist
&gt;             as directory
&gt;               /home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js doesn't exist
&gt;       /home/nowuser/src/config/node_modules doesn't exist or is not a directory
&gt;       /home/nowuser/node_modules doesn't exist or is not a directory
&gt;       /home/node_modules doesn't exist or is not a directory
&gt;       /node_modules doesn't exist or is not a directory
&gt;       looking for modules in /home/nowuser/src/node_modules
&gt;         using description file: /home/nowuser/src/package.json (relative path: ./node_modules)
&gt;           Field 'browser' doesn't contain a valid alias configuration
&gt;         after using description file: /home/nowuser/src/package.json (relative path: ./node_modules)
&gt;           using description file: /home/nowuser/src/package.json (relative path: ./node_modules/node_modules/next/config.js)
&gt;             no extension
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js doesn't exist
&gt;             .js
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.js doesn't exist
&gt;             .jsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.jsx doesn't exist
&gt;             .json
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.json doesn't exist
&gt;             .ts
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.ts doesn't exist
&gt;             .tsx
&gt;               Field 'browser' doesn't contain a valid alias configuration
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js.tsx doesn't exist
&gt;             as directory
&gt;               /home/nowuser/src/node_modules/node_modules/next/config.js doesn't exist
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.js]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.jsx]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.json]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.ts]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js.tsx]
&gt; [/home/nowuser/src/node_modules/next/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/config/node_modules]
&gt; [/home/nowuser/node_modules]
&gt; [/home/node_modules]
&gt; [/node_modules]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.js]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.jsx]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.json]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.ts]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js.tsx]
&gt; [/home/nowuser/src/node_modules/node_modules/next/config.js]
&gt;  @ ./config/env.ts 4:16-54
&gt;  @ ./config/index.ts
&gt;  @ ./pages-code/login/make-linkedin-url.ts
&gt;  @ ./pages/login.js
&gt;  @ multi ./pages/login.js
&gt;     at /home/nowuser/src/node_modules/next/dist/server/build/index.js:207:31
&gt;     at runWithDependencies (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:154:4)
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1126:9
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:473:16
&gt;     at iteratorCallback (/home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1050:13)
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:958:16
&gt;     at /home/nowuser/src/node_modules/webpack/node_modules/async/dist/async.js:1123:13
&gt;     at runCompilers (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:96:47)
&gt;     at fn (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:101:6)
&gt;     at compiler.run (/home/nowuser/src/node_modules/webpack/lib/MultiCompiler.js:150:5)
&gt;     at emitRecords.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:265:13)
&gt;     at Compiler.emitRecords (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:371:38)
&gt;     at emitAssets.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:258:10)
&gt;     at applyPluginsAsyncSeries1.err (/home/nowuser/src/node_modules/webpack/lib/Compiler.js:364:12)
&gt;     at next (/home/nowuser/src/node_modules/tapable/lib/Tapable.js:218:11)
&gt;     at Compiler.compiler.plugin (/home/nowuser/src/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>add <code class="notranslate">import getConfig from 'next/config'</code> in a project using <code class="notranslate">@zeit/next-typescript</code></li>
<li><code class="notranslate">next build</code></li>
</ol>
<p dir="auto">the error doesn't present in development</p>
<h2 dir="auto">Context</h2>
<p dir="auto">I'm fairly new to typescript. a google shows this sort of error in different contexts, but the most common solution is to add <code class="notranslate">ts</code> to the webpack loader resolver. This is already done in <code class="notranslate">next</code>, though, so the solution is N/A.</p>
<p dir="auto">I've also tried the following:</p>
<ul dir="auto">
<li>change file importing from <code class="notranslate">next/config</code> to a <code class="notranslate">.js</code></li>
<li><code class="notranslate">import * as getConfig from 'next/config'</code></li>
<li><code class="notranslate">const getConfig = require('next/config')</code></li>
<li><code class="notranslate">import getConfig from '../node_modules/next/dist/lib/runtime-config.js'</code></li>
</ul>
<p dir="auto">Could this be b/c <code class="notranslate">@types/next</code> doesn't seem to have a <code class="notranslate">config</code> export?</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>5.0.1-canary.10</td>
</tr>
<tr>
<td>node</td>
<td>on <code class="notranslate">now</code>, 8.9.4</td>
</tr>
<tr>
<td>OS</td>
<td><code class="notranslate">now</code></td>
</tr>
<tr>
<td>browser</td>
<td>na</td>
</tr>
<tr>
<td>@zeit/next-typescript</td>
<td>0.0.10</td>
</tr>
</tbody>
</table>
<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">In development mode, the entire application works fine, but in the production assembly, the main page is not initialized. I get html, index.js, but the react is not initialized<br>
There are no errors in the console.<br>
The problem is only on next@8, on next@7 there are no problems.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">I don't think I can repeat this case.<br>
This problem appears on my computer and on the host machine.</p>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">I expect that react will make hydration and start working.</p>
<h2 dir="auto">Screenshots</h2>
<p dir="auto">On index page <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11390039/52960536-1453bd80-33aa-11e9-813a-e8d4bc085db4.png"><img src="https://user-images.githubusercontent.com/11390039/52960536-1453bd80-33aa-11e9-813a-e8d4bc085db4.png" alt="image" style="max-width: 100%;"></a><br>
On other pages <a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11390039/52960581-27ff2400-33aa-11e9-943c-d81a374d25e3.png"><img src="https://user-images.githubusercontent.com/11390039/52960581-27ff2400-33aa-11e9-943c-d81a374d25e3.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11390039/52960761-84fada00-33aa-11e9-8f10-61e2393d89b5.png"><img src="https://user-images.githubusercontent.com/11390039/52960761-84fada00-33aa-11e9-8f10-61e2393d89b5.png" alt="image" style="max-width: 100%;"></a><br>
The screenshot shows that all the necessary scripts are connected to the page.</p>
<h2 dir="auto">System information</h2>
<ul dir="auto">
<li>OS: macOs/linux</li>
<li>Browser: chrome, safari, firefox</li>
<li>Version of Next.js: 8.01</li>
</ul>