简体   繁体   中英

Can't build React app from inside Google App Engine

I am trying to build my React app after deployment on GAE - ie create the build folder by putting the following start script in my package.json

"start": "react-scripts build"

...but I can't seem to build.

Also, every tutorial I see mentions building it first before deploying on GAE. Why doesn't it build after deployment?

My package.json

{
 "name": "@App/client",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-scripts": "3.0.1",
    "redux": "^4.0.1"
  },
  "scripts": {
    "local": "react-scripts start",
    "start": "react-scripts build", 
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

My app.yaml file

runtime: nodejs10
instance_class: F2

env_variables:
  POSTGRES_HOST: /cloudsql/development-omix-platform:europe-west2:omixplatform
  INSTANCE_CONNECTION_NAME: development-omix-platform:europe-west2:omixplatform
  PORT: 8080
  DEBUG: graphile-build-pg
  FIREBASE_SERVICE_ACCOUNT_JSON_FILE_NAME: firebase-service-account.json

handlers:
  - url: /
    static_files: build/index.html
    upload: build/index.html

  - url: /api/.*
    script: auto

  - url: /graphql
    script: auto

  - url: /graphiql
    script: auto

  - url: /__postgraphql/.*
    script: auto

  - url: /(.*\..*)$
    static_files: client/\1
    upload: client/(.*)

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

I expect a build folder to be created for the new version deployed, but it doesn't happen.`

Here are the logs from GAE:

Updated my package.json to reflect correctly.I am using react-scripts build as the start script.Here is the log from the deployment: ````[
  {
    "protoPayload": {
      "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
      "status": {},
      "authenticationInfo": {
        "principalEmail": "siddiquisarik@gmail.com"
      },
      "requestMetadata": {
        "callerIp": "27.7.91.59",
        "callerSuppliedUserAgent": "google-cloud-sdk x_Tw5K8nnjoRAqULM9PFAC2b gcloud/257.0.0 command/gcloud.app.deploy invocation-id/3a31d2254493473dabd0906852ba7b57 environment/None environment-version/None interactive/True from-script/False python/2.7.13 term/ (Windows NT 10.0.17134),gzip(gfe)",
        "requestAttributes": {},
        "destinationAttributes": {}
      },
      "serviceName": "appengine.googleapis.com",
      "methodName": "google.appengine.v1.Versions.CreateVersion",
      "authorizationInfo": [
        {
          "resource": "apps/emaily-dev-229719/services/default/versions/20190808t113803",
          "permission": "appengine.versions.create",
          "granted": true,
          "resourceAttributes": {}
        }
      ],
      "resourceName": "apps/emaily-dev-229719/services/default/versions/20190808t113803",
      "serviceData": {
        "@type": "type.googleapis.com/google.appengine.v1.AuditData",
        "createVersion": {
          "request": {
            "parent": "apps/emaily-dev-229719/services/default",
            "version": {
              "id": "20190808t113803",
              "instanceClass": "F2",
              "runtime": "nodejs10",
              "envVariables": {
                "DEBUG": "graphile-build-pg",
                "FIREBASE_SERVICE_ACCOUNT_JSON_FILE_NAME": "firebase-service-account.json",
                "INSTANCE_CONNECTION_NAME": "development-omix-platform:europe-west2:omixplatform",
                "PORT": "8080",
                "POSTGRES_HOST": "/cloudsql/development-omix-platform:europe-west2:omixplatform"
              },
              "entrypoint": {
                "shell": ""
              }
            }
          }
        }
      },
      "resourceLocation": {
        "currentLocations": [
          "asia-south1"
        ]
      }
    },
    "insertId": "-f8xiere12hkk",
    "resource": {
      "type": "gae_app",
      "labels": {
        "version_id": "20190808t113803",
        "module_id": "default",
        "project_id": "emaily-dev-229719"
      }
    },
    "timestamp": "2019-08-08T06:08:11.156Z",
    "severity": "NOTICE",
    "logName": "projects/emaily-dev-229719/logs/cloudaudit.googleapis.com%2Factivity",
    "operation": {
      "id": "6b80dc4e-070d-4eea-99fe-0e22a25815a8",
      "producer": "appengine.googleapis.com/admin",
      "first": true
    },
    "receiveTimestamp": "2019-08-08T06:08:13.784603661Z"
  },
  {
    "protoPayload": {
      "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
      "authenticationInfo": {
        "principalEmail": "siddiquisarik@gmail.com"
      },
      "requestMetadata": {
        "requestAttributes": {},
        "destinationAttributes": {}
      },
      "serviceName": "appengine.googleapis.com",
      "methodName": "google.appengine.v1.Versions.CreateVersion",
      "resourceName": "apps/emaily-dev-229719/services/default/versions/20190808t113803",
      "resourceLocation": {
        "currentLocations": [
          "asia-south1"
        ]
      }
    },
    "insertId": "-6dlv9vdh0gm",
    "resource": {
      "type": "gae_app",
      "labels": {
        "project_id": "emaily-dev-229719",
        "version_id": "20190808t113803",
        "module_id": "default"
      }
    },
    "timestamp": "2019-08-08T06:09:45.201Z",
    "severity": "NOTICE",
    "logName": "projects/emaily-dev-229719/logs/cloudaudit.googleapis.com%2Factivity",
    "operation": {
      "id": "6b80dc4e-070d-4eea-99fe-0e22a25815a8",
      "producer": "appengine.googleapis.com/admin",
      "last": true
    },
    "receiveTimestamp": "2019-08-08T06:09:45.476924659Z"
  }
]

Adding build logs

starting build "0efe9d27-d864-455a-8319-2ddab8300544"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://staging.emaily-dev-229719.appspot.com/ae/6b80dc4e-070d-4eea-99fe-0e22a25815a8/manifest.json.
Step #0 - "fetcher": Processing 14 files.
Step #0 - "fetcher": ******************************************************
Step #0 - "fetcher": Status: SUCCESS
Step #0 - "fetcher": Started: 2019-08-08T06:08:21Z
Step #0 - "fetcher": Completed: 2019-08-08T06:08:23Z
Step #0 - "fetcher": Requested workers: 200
Step #0 - "fetcher": Actual workers: 14
Step #0 - "fetcher": Total files: 14
Step #0 - "fetcher": Total retries: 0
Step #0 - "fetcher": GCS timeouts: 0
Step #0 - "fetcher": MiB downloaded: 0.44 MiB
Step #0 - "fetcher": MiB/s throughput: 0.26 MiB/s
Step #0 - "fetcher": Time for manifest: 899.39 ms
Step #0 - "fetcher": Total time: 2.59 s
Step #0 - "fetcher": ******************************************************
Finished Step #0 - "fetcher"
Starting Step #1 - "builder"
Step #1 - "builder": Pulling image: gcr.io/gae-runtimes/nodejs10_app_builder:nodejs10_20190602_10_16_0_RC00
Step #1 - "builder": nodejs10_20190602_10_16_0_RC00: Pulling from gae-runtimes/nodejs10_app_builder
Step #1 - "builder": Digest: sha256:8d016fee32b529f5e7083ad2c4e4d8f26b9b47d35db7102e3569791bcbb737ce
Step #1 - "builder": Status: Downloaded newer image for gcr.io/gae-runtimes/nodejs10_app_builder:nodejs10_20190602_10_16_0_RC00
Step #1 - "builder": 2019/08/08 06:08:26 Starting commonbuild with args [commonbuild --runtime=nodejs10 --entrypoint= --src=/workspace --config-file=/.gaeconfig/app_start.json -- ftl.par --name=asia.gcr.io/emaily-dev-229719/app-engine-tmp/app/ttl-2h:6b80dc4e-070d-4eea-99fe-0e22a25815a8 --directory=/workspace --destination=/srv --cache-repository=asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d --cache --additional-directory=/.gaeconfig --builder-output-path="" --base=asia.gcr.io/gae-runtimes/nodejs10:nodejs10_20190602_10_16_0_RC00].
Step #1 - "builder": 2019/08/08 06:08:26 No start command generator found for nodejs10, using default app start command "serve".
Step #1 - "builder": 2019/08/08 06:08:26 Writing configuration file "/.gaeconfig/app_start.json".
Step #1 - "builder": 2019/08/08 06:08:26 Invoking build command "ftl.par --name=asia.gcr.io/emaily-dev-229719/app-engine-tmp/app/ttl-2h:6b80dc4e-070d-4eea-99fe-0e22a25815a8 --directory=/workspace --destination=/srv --cache-repository=asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d --cache --additional-directory=/.gaeconfig --builder-output-path=\"\" --base=asia.gcr.io/gae-runtimes/nodejs10:nodejs10_20190602_10_16_0_RC00".
Step #1 - "builder": INFO FTL version node-v0.17.0
Step #1 - "builder": INFO Beginning FTL build for node
Step #1 - "builder": INFO FTL arg passed: exposed_ports None
Step #1 - "builder": INFO FTL arg passed: cache_repository asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d
Step #1 - "builder": INFO FTL arg passed: tar_base_image_path None
Step #1 - "builder": INFO FTL arg passed: export_cache_stats False
Step #1 - "builder": INFO FTL arg passed: builder_output_path ""
Step #1 - "builder": INFO FTL arg passed: name asia.gcr.io/emaily-dev-229719/app-engine-tmp/app/ttl-2h:6b80dc4e-070d-4eea-99fe-0e22a25815a8
Step #1 - "builder": INFO FTL arg passed: ttl 168
Step #1 - "builder": INFO FTL arg passed: global_cache False
Step #1 - "builder": INFO FTL arg passed: cache True
Step #1 - "builder": INFO FTL arg passed: upload True
Step #1 - "builder": INFO FTL arg passed: sh_c_prefix False
Step #1 - "builder": INFO FTL arg passed: fail_on_error True
Step #1 - "builder": INFO FTL arg passed: base asia.gcr.io/gae-runtimes/nodejs10:nodejs10_20190602_10_16_0_RC00
Step #1 - "builder": INFO FTL arg passed: output_path None
Step #1 - "builder": INFO FTL arg passed: cache_key_version v0.17.0
Step #1 - "builder": INFO FTL arg passed: cache_salt 
Step #1 - "builder": INFO FTL arg passed: directory /workspace
Step #1 - "builder": INFO FTL arg passed: entrypoint None
Step #1 - "builder": INFO FTL arg passed: additional_directory /.gaeconfig
Step #1 - "builder": INFO FTL arg passed: destination_path /srv
Step #1 - "builder": INFO FTL arg passed: verbosity NOTSET
Step #1 - "builder": INFO starting: full build
Step #1 - "builder": INFO starting: builder initialization
Step #1 - "builder": INFO Loading Docker credentials for repository 'asia.gcr.io/gae-runtimes/nodejs10:nodejs10_20190602_10_16_0_RC00'
Step #1 - "builder": INFO Loading Docker credentials for repository 'asia.gcr.io/emaily-dev-229719/app-engine-tmp/app/ttl-2h:6b80dc4e-070d-4eea-99fe-0e22a25815a8'
Step #1 - "builder": INFO builder initialization took 0 seconds
Step #1 - "builder": INFO starting: build process for FTL image
Step #1 - "builder": INFO starting: rm_node_modules
Step #1 - "builder": INFO rm_node_modules rm -rf /workspace/node_modules
Step #1 - "builder": INFO `rm_node_modules` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO rm_node_modules took 0 seconds
Step #1 - "builder": INFO using descriptor:yarn.lock
Step #1 - "builder": INFO using descriptor:package.json
Step #1 - "builder": INFO starting: checking_cached_packages_json_layer
Step #1 - "builder": DEBUG Checking cache for cache_key 2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29
Step #1 - "builder": INFO No cached base image found for entry: asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d/node-cache:2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29.
Step #1 - "builder": INFO Cache miss on local cache for asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d/node-cache:2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29
Step #1 - "builder": INFO No cached dependency layer for 2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29
Step #1 - "builder": INFO [CACHE][MISS] v0.17.0:NODE->2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29
Step #1 - "builder": INFO checking_cached_packages_json_layer took 0 seconds
Step #1 - "builder": INFO starting: building_packages_json_layer
Step #1 - "builder": INFO starting: yarn_install
Step #1 - "builder": INFO yarn_install yarn install --production
Step #1 - "builder": INFO `yarn_install` stdout:
Step #1 - "builder": yarn install v1.9.4
Step #1 - "builder": [1/4] Resolving packages...
Step #1 - "builder": [2/4] Fetching packages...
Step #1 - "builder": info fsevents@2.0.6: The platform "linux" is incompatible with this module.
Step #1 - "builder": info "fsevents@2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
Step #1 - "builder": info fsevents@1.2.9: The platform "linux" is incompatible with this module.
Step #1 - "builder": info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
Step #1 - "builder": [3/4] Linking dependencies...
Step #1 - "builder": [4/4] Building fresh packages...
Step #1 - "builder": Done in 38.66s.
Step #1 - "builder": 
Step #1 - "builder": INFO `yarn_install` had stderr output:
Step #1 - "builder": warning "react-scripts > @typescript-eslint/eslint-plugin@1.6.0" has unmet peer dependency "typescript@*".
Step #1 - "builder": warning "react-scripts > @typescript-eslint/parser@1.6.0" has unmet peer dependency "typescript@*".
Step #1 - "builder": warning "react-scripts > ts-pnp@1.1.2" has unmet peer dependency "typescript@*".
Step #1 - "builder": warning "react-scripts > @typescript-eslint/eslint-plugin > @typescript-eslint/typescript-estree@1.6.0" has unmet peer dependency "typescript@*".
Step #1 - "builder": warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
Step #1 - "builder": 
Step #1 - "builder": INFO yarn_install took 39 seconds
Step #1 - "builder": INFO starting: tar_runtime_package
Step #1 - "builder": INFO tar_runtime_package tar -pcf /tmp/tmp14UUYM.tar --hard-dereference --transform flags=r;s,^,/srv/node_modules/, --exclude *.pyc .
Step #1 - "builder": INFO `tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO tar_runtime_package took 0 seconds
Step #1 - "builder": INFO starting: gzip_tar_runtime_package
Step #1 - "builder": INFO gzip_tar_runtime_package gzip /tmp/tmp14UUYM.tar -1
Step #1 - "builder": INFO `gzip_tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO gzip_tar_runtime_package took 2 seconds
Step #1 - "builder": INFO starting: rm_node_modules
Step #1 - "builder": INFO rm_node_modules rm -rf /workspace/node_modules
Step #1 - "builder": INFO `rm_node_modules` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO rm_node_modules took 0 seconds
Step #1 - "builder": INFO building_packages_json_layer took 43 seconds
Step #1 - "builder": INFO starting: uploading_packages_json_layer
Step #1 - "builder": INFO Layer sha256:770e78845ef75d41d0555b936a55cbecf2073d003fe4811284ef44d31054bbd1 pushed.
Step #1 - "builder": INFO Layer sha256:f341002bd84f37c2963472ebebea9d3c90ac6e2627b3fde7377a87e9f3e83c69 pushed.
Step #1 - "builder": INFO Finished upload of: asia.gcr.io/emaily-dev-229719/app-engine-tmp/build-cache/ttl-7d/node-cache:2664c8e15d525a968e27ebe3bb094ddf40e661d41a9043edaf265ec95c055d29
Step #1 - "builder": INFO uploading_packages_json_layer took 8 seconds
Step #1 - "builder": INFO starting: Building app layer
Step #1 - "builder": INFO starting: tar_runtime_package
Step #1 - "builder": INFO tar_runtime_package tar -pcf /tmp/tmp46oxw8.tar --hard-dereference --transform flags=r;s,^,/srv/, --exclude *.pyc .
Step #1 - "builder": INFO `tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO tar_runtime_package took 0 seconds
Step #1 - "builder": INFO starting: gzip_tar_runtime_package
Step #1 - "builder": INFO gzip_tar_runtime_package gzip /tmp/tmp46oxw8.tar -1
Step #1 - "builder": INFO `gzip_tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO gzip_tar_runtime_package took 0 seconds
Step #1 - "builder": INFO Finished gzipping tarfile.
Step #1 - "builder": INFO Building app layer took 0 seconds
Step #1 - "builder": INFO starting: Building app layer
Step #1 - "builder": INFO starting: tar_runtime_package
Step #1 - "builder": INFO tar_runtime_package tar -pcf /tmp/tmphzX880.tar --hard-dereference --transform flags=r;s,^,/.gaeconfig/, --exclude *.pyc .
Step #1 - "builder": INFO `tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO tar_runtime_package took 0 seconds
Step #1 - "builder": INFO starting: gzip_tar_runtime_package
Step #1 - "builder": INFO gzip_tar_runtime_package gzip /tmp/tmphzX880.tar -1
Step #1 - "builder": INFO `gzip_tar_runtime_package` stdout:
Step #1 - "builder": 
Step #1 - "builder": INFO gzip_tar_runtime_package took 0 seconds
Step #1 - "builder": INFO Finished gzipping tarfile.
Step #1 - "builder": INFO Building app layer took 0 seconds
Step #1 - "builder": INFO starting: Stitching layers into final image
Step #1 - "builder": INFO Stitching layers into final image took 0 seconds
Step #1 - "builder": INFO starting: Uploading final image
Step #1 - "builder": INFO starting: Pushing image to Docker registry
Step #1 - "builder": INFO Pushing final image...
Step #1 - "builder": INFO Layer sha256:f341002bd84f37c2963472ebebea9d3c90ac6e2627b3fde7377a87e9f3e83c69 exists, skipping
Step #1 - "builder": INFO Layer sha256:3c2cba919283a210665e480bcbf943eaaf4ed87a83f02e81bb286b8bdead0e75 exists, skipping
Step #1 - "builder": INFO Layer sha256:75c5cf2a0cfac9f36b9eff671bfb135c9e893bd126e3f1ca29880e094b71ef59 exists, skipping
Step #1 - "builder": INFO Layer sha256:517783fc8820a78d42a17058fb41d300464b2f57666b79b263b71473ce0add58 exists, skipping
Step #1 - "builder": INFO Layer sha256:3e6140238cb96ed591571804c4abc9935a800ddcc6661a89dda9d3917ae90f7a exists, skipping
Step #1 - "builder": INFO Layer sha256:992de7a46af205f308bbbe2a0438b371a5ab9bb1d367cad03c86dd3a34ee7442 exists, skipping
Step #1 - "builder": INFO Layer sha256:49e24c87983c8a9441263a3ae58c98691a0b0d228e7af0414a39d78638a10451 exists, skipping
Step #1 - "builder": INFO Layer sha256:4f083d4df15f0671110e16e80efc7d410e316f9f3ca549d4c532551b21a4fbde exists, skipping
Step #1 - "builder": INFO Layer sha256:deabf7bad5e7feeee5b21092bd193ecbd1b227d1fe1eae287fddb10c952e9e35 exists, skipping
Step #1 - "builder": INFO Layer sha256:729a2199e385e7c3b1d473adb6ad74f888d88537f3cb5fba50a2223e528f2af1 exists, skipping
Step #1 - "builder": INFO Layer sha256:c06ebd05b949f8c382380fa7b6cb45b9b39a9ca25ba3eb819803a9b5e08b8798 exists, skipping
Step #1 - "builder": INFO Layer sha256:a1fe0bd3e83030687176951a74a2bdfba3de9f032bf371412e9a9b0d646fe087 exists, skipping
Step #1 - "builder": INFO Layer sha256:3aed06531a572af8cda05edf7544b27c4d48572df65831e051c4cebdbdd7f253 mounted.
Step #1 - "builder": INFO Layer sha256:3aed06531a572af8cda05edf7544b27c4d48572df65831e051c4cebdbdd7f253 pushed.
Step #1 - "builder": INFO Layer sha256:ead752f81c3ec2c2a6ac6692c4c9df2e5e1389552ed0b79a48e2d595d122b8fa mounted.
Step #1 - "builder": INFO Layer sha256:ead752f81c3ec2c2a6ac6692c4c9df2e5e1389552ed0b79a48e2d595d122b8fa pushed.
Step #1 - "builder": INFO Layer sha256:0ab6231c1a046e6afdf063797ef9e7bec7b6f2bf0a706b673ece2ecbe49ba425 mounted.
Step #1 - "builder": INFO Layer sha256:0ab6231c1a046e6afdf063797ef9e7bec7b6f2bf0a706b673ece2ecbe49ba425 pushed.
Step #1 - "builder": INFO Layer sha256:6d78a22a5429819bb4c7c261fa2c8921ea24fc61c83f0ee58739112f660382e7 pushed.
Step #1 - "builder": INFO Layer sha256:e728a177ac564e7d9c355d434ce03da7f13874250554ef01186916a09fed9137 pushed.
Step #1 - "builder": INFO Layer sha256:20043117973e6f614d9ba35565716932fba47fecdcf13bc378b26c5de29ed6dd pushed.
Step #1 - "builder": INFO Finished upload of: asia.gcr.io/emaily-dev-229719/app-engine-tmp/app/ttl-2h:6b80dc4e-070d-4eea-99fe-0e22a25815a8
Step #1 - "builder": INFO Pushing image to Docker registry took 5 seconds
Step #1 - "builder": INFO Uploading final image took 5 seconds
Step #1 - "builder": INFO build process for FTL image took 59 seconds
Step #1 - "builder": INFO full build took 59 seconds
Finished Step #1 - "builder"
PUSH
DONE
# Dockerfile extending the generic Node image with application files for a
# single application.
FROM gcr.io/google_appengine/nodejs
COPY . /app/
# You have to specify "--unsafe-perm" with npm install
# when running as root.  Failing to do this can cause
# install to appear to succeed even if a preinstall
# script fails, and may have other adverse consequences
# as well.
# This command will also cat the npm-debug.log file after the
# build, if it exists.
RUN npm install --unsafe-perm || \
  ((if [ -f npm-debug.log ]; then \
      cat npm-debug.log; \
    fi) && false)
RUN npm install -g serve
RUN npm run-script build
CMD serve -s build

Previous submission

For a stand-alone React application, you don't have to build before deploying to Google App Engine Standard. As long as running npm start locally works, you can run gcloud app deploy with your project as it is [1], as long as the app.yaml exists and is valid.

That being said, you would need to run npm run-script build locally prior to deploying and the "start" script in the package.json should remain as react-scripts start .

You can also take a look at this article [2], which addresses a question similar to yours.

[1] https://medium.com/tech-tajawal/deploying-react-app-to-google-app-engine-a6ea0d5af132
[2] https://medium.com/google-cloud/how-to-deploy-a-static-react-site-to-google-cloud-platform-55ff0bd0f509

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM