Issues with configuring React app for App Engine Standard Environment (Node.js 8 [beta])

896 views
Skip to first unread message

event publisher

unread,
Sep 5, 2018, 10:32:32 PM9/5/18
to Google App Engine
I have developed a simple app using React and Node.js 8 for Google App Engine. 

It works perfectly fine locally and deployed on the Flexible Environment, but if I try to deploy it on the Standard Environment by changing app.yaml, I get repeated 500 Server Errors with minimal information in the logs. I am getting "GET / HTTP/1.1" 500 errors but have no other ideas about what might be the problem.

I am guessing the reason why it is failing probably has something to do with the fact that there are additional folders, /src/ and /public/ needed for my React app. The folder structure of my project is the default one created by create-react-app. I have attempted to configure the app.yaml by adding the index.js from react as a script, or by making everything application viewable in handlers, in various combinations, but this hasn't resolved the error.

Has anyone encountered a similar problem? If you've gotten a react app with /src/ and /public/ folders working in the Standard Environment, I'd be interested in seeing how app.yaml was configured.

Binh Bui Van

unread,
Sep 5, 2018, 10:38:02 PM9/5/18
to Google App Engine
I guest you using node js as server.
Note that, GAE standard does not support nodejs.

You can config reactjs run without nodejs. Please see my config (app.yml) for sample.
---------
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: public/index.html
  upload: public/index.html
  secure: always

- url: /app(.*)
  static_files: public/index.html
  upload: public/index.html

- url: /favicon.ico
  static_files: public/favicon.ico
  upload: public/favicon.ico

- url: /assets
  static_dir: public/assets
---------

Vào 09:32:32 UTC+7 Thứ Năm, ngày 06 tháng 9 năm 2018, event publisher đã viết:

Julie (cloud platform support)

unread,
Sep 10, 2018, 10:59:33 AM9/10/18
to Google App Engine
App Engine now supports Nodejs under a beta release. The tutorial goes though setting up an sample application. Can you post screenshot of the 500 server errors and app.yaml you are using after removing all personal and sensitive information as it is not clear how you are configuring the yaml file. 

Steren Giannini

unread,
Sep 10, 2018, 10:32:44 PM9/10/18
to Google App Engine
Hi,
Thanks for the feedback.

We will try to reproduce on our side, but would you be able to share more details?
We would be interested in seeing your package.json and your app.yaml.

event publisher

unread,
Sep 18, 2018, 8:40:26 PM9/18/18
to Google App Engine
I solved the issue by building the react app first (npm run build) and adding handlers for the built app in app.yaml.

handlers:
- url: /
  static_files: build/index.html
  upload: build/index.html
- url: /
  static_dir: build
Reply all
Reply to author
Forward
0 new messages