I am trying to deploy create-react-app to elastic beanstalk. My deployment is constantly timing out with
ERROR: TimeoutError - The EB CLI timed out after 10 minute(s). The operation might still be running. To keep viewing events, run 'eb events -f'. To set timeout duration, use '--timeout MINUTES'.
I have tried a bunch of different things to get this working. This is my config.yml file
branch-defaults:
dev:
environment: uu-pilot
group_suffix: null
environment-defaults:
uu-pilot:
branch: null
repository: null
global:
application_name: uu-pilot
branch: null
default_ec2_keyname: null
default_platform: Node.js
default_region: ca-central-1
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
my nodecommand.config inside .ebextensions folder:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "npm start"
^^ I have also tried changing the the node command to react-scripts build and react-scripts start
all dependencies are under dependencies and not devDependencies in package.json, and here are my scripts
"scripts": {
"prestart": "react-scripts build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"start:prod": "react-scripts start"
}
I am getting no particular error message, and am unable to review the exact logs as that operation times out too. I've also added this in case it was just a timeout thing:
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 1800
lastly, I deployed a basic node app to see if that would work and it did, so the problem is with the way the create-react-app node server is serving the build folder.
Any direction is appreciated.
If you need to know more about React, Its recommended to join React Certification Course today.