I am unable to deploy my Nuxt JS SSR app to Google Cloud App Engine. The app is able to run locally both in dev and production mode.
The Nuxt JS documentation suggests using the app.yaml as follows:
runtime: nodejs10
instance_class: F2
handlers:
- url: /_nuxt
static_dir: .nuxt/dist/client
secure: always
- url: /(.*\.(gif|png|jpg|ico|txt))$
static_files: static/\1
upload: static/.*\.(gif|png|jpg|ico|txt)$
secure: always
- url: /.*
script: auto
secure: always
env_variables:
HOST: '0.0.0.0'
However, the Google Cloud documentation suggests using nodejs14 as well as the env_variables for the bucket name which I assume is the same name as the staging bucket automatically created by Google App Engine.
runtime: nodejs14 # or another supported version
instance_class: F2
env_variables:
BUCKET_NAME: "staging.myapp.appspot.com"
handlers:
- url: /_nuxt
static_dir: .nuxt/dist/client
secure: always
- url: /(.*\.(gif|png|jpg|ico|txt))$
static_files: static/\1
upload: static/.*\.(gif|png|jpg|ico|txt)$
secure: always
- url: /.*
script: auto
secure: always
When deploying with both of these app.yaml configurations it deploys successfully to Google App Engine however upon visiting the URL for the instance (myapp.uk.r.appspot.com) I am met with the error as follows:
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
And when visiting staging.myapp.appspot.com I am met with a range of errors from a generic Google 404 error to a certificate error. Does anyone have any idea about the correct app.yaml configuration for deploying a Nuxt JS SSR app to Google Cloud App Engine?