title: Next.js project error in production build
body: <p>I'm builded project with custom server, and starting with <code>next start</code></p>
  <p>If <code>NODE_ENV = 'production'</code> throws an error as on screen</p>
  <p>If <code>NODE_ENV != 'production'</code> it works properly, but in dev environment</p>
  <p>package.json:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>  "scripts": {
      "lint": "next lint",
      "build:next": "next build",
      "build:server": "tsc --project tsconfig.server.json",
      "build": "npm run build:next &amp;&amp; npm run build:server",
      "dev": "node server/index.js",
      "start": "set NODE_ENV=production &amp; node dist/server/index.js"
    },</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/NvscM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NvscM.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/SJq0m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SJq0m.png" alt="enter image description here" /></a></p>