title: How do I get my nodejs app deployment to load next build resources (404 console error strips my website of all react components)
body: <p>Straight up, the same code deployed two different ways:</p>
  <p><strong>npm run dev on my localhost</strong>
  <a href="https://02e7822e.ngrok.io" rel="nofollow noreferrer">https://02e7822e.ngrok.io</a></p>
  <p><strong>npm start (I assume) on Google App Engine</strong>
  <a href="https://testing-234701.appspot.com/" rel="nofollow noreferrer">https://testing-234701.appspot.com/</a></p>
  <p>I have to stress that this is the same code being deployed (obviously very much tailored in package.json to deploy to App Engine) but only one of them looks correct.</p>
  <p>I'm sure we're all thinking it's a problem with package.json, so I'll include it below, but <strong>if anyone has ever encountered a similar problem where a nodejs app looks fine on localhost but then looks like shit on deploy, PLEASE LET ME KNOW!</strong></p>
  <p><strong>Chrome Console error:</strong> Failed to load resource: <a href="https://testing-234701.appspot.com/%7BsummarAIze%7D/_next/static/6MuW3BriROYrhZZCL%7Ev03/pages/index.jsthe" rel="nofollow noreferrer">https://testing-234701.appspot.com/%7BsummarAIze%7D/_next/static/6MuW3BriROYrhZZCL~v03/pages/index.jsthe</a> server responded with a status of 404 ()</p>
  <p>^note, the resource that wasn't loaded deals with _next, so it must be related to next.js</p>
  <p><strong>package.json</strong></p>
  <pre><code>{
  &quot;name&quot;: &quot;hps_prework&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
    &quot;dev&quot;: &quot;node app.js&quot;,
    &quot;build&quot;: &quot;next build&quot;,
    &quot;start&quot;: &quot;NODE_ENV=production &amp;&amp; node app.js&quot;,
    &quot;gcp-build&quot;: &quot;npm run build&quot;,
    &quot;deploy&quot;: &quot;npm run build &amp;&amp; gcloud app deploy&quot;
  },
  &quot;engines&quot;: {
    &quot;node&quot;: &quot;&gt;10.0&quot;
  },
  &quot;keywords&quot;: [],
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;dependencies&quot;: {
    &quot;@material-ui/core&quot;: &quot;^3.9.2&quot;,
    &quot;@material-ui/icons&quot;: &quot;^3.0.2&quot;,
    &quot;babel-loader&quot;: &quot;^8.0.5&quot;,
    &quot;jquery&quot;: &quot;^3.3.1&quot;,
    &quot;js-cookie&quot;: &quot;^2.2.0&quot;,
    &quot;koa&quot;: &quot;^2.7.0&quot;,
    &quot;koa-session&quot;: &quot;^5.10.1&quot;,
    &quot;next&quot;: &quot;^8.0.3&quot;,
    &quot;python-shell&quot;: &quot;^1.0.7&quot;,
    &quot;react&quot;: &quot;^16.8.4&quot;,
    &quot;react-dom&quot;: &quot;^16.8.4&quot;,
    &quot;react-scripts&quot;: &quot;^2.1.8&quot;,
    &quot;webpack&quot;: &quot;^4.28.3&quot;
  },
  &quot;browserslist&quot;: [
    &quot;&gt;0.2%&quot;,
    &quot;not dead&quot;,
    &quot;not ie &lt;= 11&quot;,
    &quot;not op_mini all&quot;
  ]
  </code></pre>
  <p>}</p>
  <p>I should also note that I took some inspiration for my package.json scripts from this prev SO question: <a href="https://stackoverflow.com/questions/52825615/deployed-a-next-js-application-to-app-engine-standard-nodejs-and-got-a-500-err">Deployed a Next.js application to App Engine Standard [Nodejs] and got a 500 error</a></p>
  <p>I am deploying to App Engine with <code>gcloud app deploy</code> and the logged output from that doesn't show any problems. It's just when the webpage is loaded, everything's just broken.</p>
  <p><em>Edit: I also don't know if this is helpful at all, but I deployed the same app to AWS Elastic Beanstalk and the process was so much easier. The website loaded the same way as it did on my localhost, and AWS EB even lets the user change the npm command used to run the website, which Google App Engine doesn't seem to support.</em></p>