```There was an error synthesizing your app.```
# help
g
Copy code
There was an error synthesizing your app.
t
Hey Greg - sorry can you share more?
g
I'm new to this, so I'm not sure what else to share. My co-worker build the Notes app from scratch and published to GitHub. He then invited me to the repo. So, I cloned it to my machine and then tried to
Copy code
npx sst deploy
to my own account
Got the error above
I am running
Copy code
npx sst remove
to see if I can have a do-over and whatever went wrong is now ok
t
can you share more of the log?
g
Copy code
gmartin:serverless-notes-app gregorymartin$ npx sst deploy
Using stage: glm
Preparing your SST app
Transpiling source
Linting source
Building Lambda function src/create.main
Building Lambda function src/get.main
Building Lambda function src/list.main
Building Lambda function src/update.main
Building Lambda function src/delete.main
Building Lambda function src/billing.main
Building static site frontend

> frontend@0.1.0 build /Users/gregorymartin/local_sites/serverless-notes-app/frontend
> react-scripts build

sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! frontend@0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gregorymartin/.npm/_logs/2021-11-04T13_29_09_308Z-debug.log

Error: There was a problem building the "ReactSite" StaticSite.
    at ReactStaticSite.buildApp (/Users/gregorymartin/local_sites/serverless-notes-app/node_modules/@serverless-stack/resources/src/StaticSite.ts:191:15)
    at new StaticSite (/Users/gregorymartin/local_sites/serverless-notes-app/node_modules/@serverless-stack/resources/src/StaticSite.ts:93:24)
    at new ReactStaticSite (/Users/gregorymartin/local_sites/serverless-notes-app/node_modules/@serverless-stack/resources/src/ReactStaticSite.ts:43:5)
    at new FrontendStack (/Users/gregorymartin/local_sites/serverless-notes-app/stacks/FrontendStack.js:10:22)
    at Object.main (/Users/gregorymartin/local_sites/serverless-notes-app/stacks/index.js:18:5)
    at Object.<anonymous> (/Users/gregorymartin/local_sites/serverless-notes-app/.build/run.js:93:16)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)

There was an error synthesizing your app.
gmartin:serverless-notes-app gregorymartin$ npx sst remove
0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ] 2 info using npm@6.13.4 3 info using node@v12.16.1 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle frontend@0.1.0~prebuild: frontend@0.1.0 6 info lifecycle frontend@0.1.0~build: frontend@0.1.0 7 verbose lifecycle frontend@0.1.0~build: unsafe-perm in lifecycle true 8 verbose lifecycle frontend@0.1.0~build: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/Users/gregorymartin/local sites/serverless notes app/frontend/node modules/.bin/Users/gregorymartin/local_sites/serverless-notes-app/node_modules/.bin/Users/gregorymartin/google cloud sdk/bin/usr/local/sbin:/usr/local/opt/php@7.2/sbin:/usr/local/opt/php@7.2/bin/usr/local/sbin/opt/local/bin/opt/local/sbin/usr/local/bin/usr/bin/bin/usr/sbin/sbin/Library/Apple/usr/bin/usr/local/Applications/DevDesktop/tools/Users/gregorymartin/documents/code/drush 9 verbose lifecycle frontend@0.1.0~build: CWD: /Users/gregorymartin/local_sites/serverless-notes-app/frontend 10 silly lifecycle frontend@0.1.0~build: Args: [ '-c', 'react-scripts build' ] 11 info lifecycle frontend@0.1.0~build: Failed to exec build script 12 verbose stack Error: frontend@0.1.0 build:
react-scripts build
12 verbose stack spawn ENOENT 12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js4818) 12 verbose stack at ChildProcess.emit (events.js31120) 12 verbose stack at maybeClose (internal/child_process.js102116) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js2865) 13 verbose pkgid frontend@0.1.0 14 verbose cwd /Users/gregorymartin/local_sites/serverless-notes-app/frontend 15 verbose Darwin 20.6.0 16 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" 17 verbose node v12.16.1 18 verbose npm v6.13.4 19 error code ELIFECYCLE 20 error syscall spawn 21 error file sh 22 error errno ENOENT 23 error frontend@0.1.0 build:
react-scripts build
23 error spawn ENOENT 24 error Failed at the frontend@0.1.0 build script. 24 error This is probably not a problem with npm. There is likely additional logging output above. 25 verbose exit [ 1, true ]
Copy code
npx sst remove
finished and now I am try again with
Copy code
npx sst start
t
Can you go into the
frontend
folder
and run
npm i
g
oh, are there 2 different places where I need to run
Copy code
npm install
?
t
It looks like the issue is it's failing to build the frontend because
react-scripts
is not found. The frontend app is its own project with its own dependencies that it needs
Yeah - this can be solved if using
yarn
instead of
npm
and taking advantage of workspaces - running
yarn
at the root will install dependencies for all sub-projects
g
That's what I get for not going through the tutorial myself 😉
Now, I get this...
Copy code
Deploying stacks
Checking deploy status...
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::CloudFormation::Stack | glm-serverless-app-storage
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::S3::Bucket | UploadsBucketC4B27CC7
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::CDK::Metadata | SSTMetadata
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::DynamoDB::Table | NotesTable7100B0E8
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::S3::Bucket | UploadsBucketC4B27CC7
glm-serverless-app-storage | CREATE_FAILED | AWS::DynamoDB::Table | NotesTable7100B0E8 glm-serverless-app-Notes already exists
glm-serverless-app-storage | CREATE_IN_PROGRESS | AWS::CDK::Metadata | SSTMetadata
glm-serverless-app-storage | CREATE_COMPLETE | AWS::CDK::Metadata | SSTMetadata
Checking deploy status...
Checking deploy status...
glm-serverless-app-storage | CREATE_COMPLETE | AWS::S3::Bucket | UploadsBucketC4B27CC7
glm-serverless-app-storage | CREATE_FAILED | AWS::CloudFormation::Stack | glm-serverless-app-storage

 ❌  glm-serverless-app-storage failed: glm-serverless-app-Notes already exists


Stack glm-serverless-app-storage
  Status: failed
  Error: glm-serverless-app-Notes already exists

Stack glm-serverless-app-api
  Status: not deployed
Cannot convert undefined or null to object
Copy code
message: 'This stack is currently in a non-terminal [CREATE_FAILED] state. To update the stack from this state, please use the disable-rollback parameter with update-stack API. To rollback to the last known good state, use the rollback-stack API',
t
When a stack is removed, certain resources by default aren't deleted (usually statefull ones)
So the Dynamo table wasn't deleted - you'd have to go in and manually delete it form the aws ui
You can also change this behavior for non-production stages
g
what is the "update-stack api"?
t
First delete the table in the ui then try to run
Copy code
sst start
If that doesn't work try
Copy code
sst start --rollback=true
g
I am in the AWS UI deleting the table now
When I go into the AWS UI, the default is OHIO
But it built the table in N Virginia
I think that's a function of cloning my co-worker's repo
his sst.json file had
Copy code
region: "us-east-1"
Just FYI. I had begun the tutorial myself yesterday. I used a different folder name than Ryan did, so no conflict. When I cloned his repo, I started
Copy code
npx sst remove
on my stuff and then ran
Copy code
npx sst start
from the folder associated with his cloned repo. So, I had a remove and a deploy running at the same time. Different folder/project names, but still. That may have been part of the cause of this issue.