title: Getting 404 page while serving the build of the NextJs App while its running fine in the development mode
body: <p>I am pretty new to React/Next JS. So here's my issue. I have purchased a theme and made changes to the config and branding part. Now when I run the app using &quot;yarn dev&quot; and &quot;yarn start&quot;, it is working fine. &quot;yarn build&quot; also creates an optimized production build. I wanted to deploy the app locally in my PC and i was trying to learn things through youtube videos. so in one of the videos i found this command (&quot;prod&quot;: &quot;next build &amp;&amp; serve build&quot;) to include in package.json. my package.json file has the following scripts.</p>
  <p>&quot;scripts&quot;: {
  &quot;dev&quot;: &quot;next dev&quot;,
  &quot;build&quot;: &quot;next build&quot;,
  &quot;start&quot;: &quot;next start&quot;,
  &quot;export&quot;: &quot;next export&quot;,
  &quot;lint&quot;: &quot;eslint --fix &quot;src/<strong>/*.{js,jsx}&quot;&quot;,
  &quot;format&quot;: &quot;prettier --write &quot;src/</strong>/*.{js,jsx}&quot;&quot;,
  &quot;prod&quot;: &quot;next build &amp;&amp; serve build&quot;
  },</p>
  <p>so when i try with &quot;yarn prod&quot;, it is first creating an optimized build and then i get the following output in the vscode terminal</p>
  <p><a href="https://i.stack.imgur.com/4xlOw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4xlOw.png" alt="enter image description here" /></a></p>
  <p>however if i try to open &quot;http://localhost:3000&quot; in my browser. i get 404 error. but not with &quot;yarn dev&quot; or &quot;yarn start&quot;. no error while building the app too.</p>