title: Export static NextJS App `TypeError: Cannot read property '/404' of undefined`
body: <p>I've tried a couple of times to start a NextJS project from scratch using the quickstart method <code>npx create-next-app</code> and follow the isntructions outlined in the tutorial example <a href="https://nextjs.org/learn/excel/static-html-export/setup" rel="nofollow noreferrer">https://nextjs.org/learn/excel/static-html-export/setup</a>. I want to create a static HTML site.</p>
  
  <p>I add the <code>build</code> and <code>export</code> jobs to the <code>scripts</code> tag in <code>package.json</code>:</p>
  
  <pre><code>  "scripts": {
      "dev": "next dev",
      "build": "next build",
      "export": "next export",
      "start": "next start"
    },
  </code></pre>
  
  <p>And create a <code>next.config.js</code> file from the example:</p>
  
  <pre><code>const fetch = require('isomorphic-unfetch');
  
  module.exports = {
    exportPathMap: async function() {
      const paths = {
        '/': { page: '/' }
      };
    }
  };
  </code></pre>
  
  <p>The build runs fine but when I try to run export I get the following error:</p>
  
  <pre><code>TypeError: Cannot read property '/404' of undefined
      at _default (~/Workspace/BlogNextJS/my-blog/node_modules/next/dist/export/index.js:10:202)
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! my-blog@0.1.0 export: `next export`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the my-blog@0.1.0 export script.
  </code></pre>
  
  <p>This doesn't happen when I used the example project from the tutorial (<a href="https://github.com/zeit/next-learn-demo.git" rel="nofollow noreferrer">https://github.com/zeit/next-learn-demo.git</a>)</p>
  
  <p>Can anyone tell me what might be going on or give pointers on what to look at? </p>
  
  <p>Further information from the logs looks like this but I don't know much about what it means:</p>
  
  <pre><code>6 info lifecycle my-blog@0.1.0~export: my-blog@0.1.0
  7 verbose lifecycle my-blog@0.1.0~export: unsafe-perm in lifecycle true
  8 verbose lifecycle my-blog@0.1.0~export: PATH: /home/klol/.nvm/versions/node/v12.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/klol/Workspace/BlogNextJS/my-blog/node_modules/.bin:/home/klol/.nvm/versions/node/v12.12.0/bin:/home/klol/anaconda3/bin:/home/klol/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  9 verbose lifecycle my-blog@0.1.0~export: CWD: /home/klol/Workspace/BlogNextJS/my-blog
  10 silly lifecycle my-blog@0.1.0~export: Args: [ '-c', 'next export' ]
  11 silly lifecycle my-blog@0.1.0~export: Returned: code: 1  signal: null
  12 info lifecycle my-blog@0.1.0~export: Failed to exec export script
  13 verbose stack Error: my-blog@0.1.0 export: `next export`
  13 verbose stack Exit status 1
  13 verbose stack     at EventEmitter.&lt;anonymous&gt; (/home/klol/.nvm/versions/node/v12.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
  13 verbose stack     at EventEmitter.emit (events.js:210:5)
  13 verbose stack     at ChildProcess.&lt;anonymous&gt; (/home/klol/.nvm/versions/node/v12.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
  13 verbose stack     at ChildProcess.emit (events.js:210:5)
  13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
  13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
  14 verbose pkgid my-blog@0.1.0
  15 verbose cwd /home/klol/Workspace/BlogNextJS/my-blog
  16 verbose Linux 5.0.0-31-generic
  17 verbose argv "/home/klol/.nvm/versions/node/v12.12.0/bin/node" "/home/klol/.nvm/versions/node/v12.12.0/bin/npm" "run" "export"
  </code></pre>