Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

React app stuck on "Starting the development server..."

I am using the GCP free trial and trying to deploy a React app with Node.js to App Engine. I already have a few other projects I have used to try to deploy things that worked fine. I have cancelled billing to those projects so they are no longer active and taking up space. This project, however, gets hung on "Starting the development server...".

I run npm run build beforehand, then run gcloud app deploy. I have tried both from the Gcloud CLI and Cloud Shell. It works through all of the steps, but then gets hung on  "Starting the development server..." and finally times out after a very long time. There are no errors in the build logs. Any help would be appreciated.

 

0 2 4,037
2 REPLIES 2

Hi @yellybelly,

Welcome to Google Cloud Community!

When deploying to App Engine using Node.js, you should first check the environment variables in your project's configuration and the start script in your package.json file.

You can also try running the app locally to see if the development server starts up correctly. Additionally, check your app.yaml 
file to ensure that you have specified the correct runtime for your Node.js version and that your entry point is pointing to the correct file.

If none of these solutions work, try deploying your app to a different environment and check the App Engine logs for any errors or warnings.

Thanks

jkg
Google Developer Expert
Google Developer Expert

I don't think that the development server should be running in the cloud! The development server that comes with react is just for local development on your computer.

In the cloud you'll need to either have a webserver to forward traffic to, such as nginx, or you could do `npm run build` and copy the output of this file to a cloud storage bucket and serve the react app from there if you like. You'd need to make the bucket public.

There's a guide here that could help? https://cloud.google.com/storage/docs/hosting-static-website