 I am trying to deploy a create-react-app https://github.com/lrtico/allowance-tracker I developed to Google Cloud and am getting this error in Error Reporting when visiting the web page https://allowance-tracker-287504.wn.r.appspot.com/:
I am trying to deploy a create-react-app https://github.com/lrtico/allowance-tracker I developed to Google Cloud and am getting this error in Error Reporting when visiting the web page https://allowance-tracker-287504.wn.r.appspot.com/:
Error: Cannot find module '/workspace/server.js'
  at Function.Module._resolveFilename (loader.js:636)
  at Function.Module._load (loader.js:562)
  at Function.Module.runMain (loader.js:831)
  at startup (internal/bootstrap/node.js:283)
  at bootstrapNodeJSCore (internal/bootstrap/node.js:623)
As a test, I deployed the same build to Azure and the app runs perfectly. Any ideas on what I am missing?
I was right. I tested and I successfully deployed on App Engine by updating the app.yaml
npm run buildapp.yaml file like thisruntime: nodejs10
handlers:
  - url: /
    static_files: build/index.html
    upload: build/index.html
  - url: /
    static_dir: build
gcloud app deployI experienced the same error. It was because I mistakenly removed the start script.
From the GCP AppEngine doc :
By default, the runtime starts your application by running
nodeserver.js. If you specify a start script in yourpackage.jsonfile, the runtime runs the specified start script instead
The other way is as defined here :
You can override this behavior by specifying a script in the entrypoint field in
app.yaml. Instead of running node server.js or a start script, the runtime starts your application with the command you specify in entrypoint
See : https://cloud.google.com/appengine/docs/standard/nodejs/runtime#application_startup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With