Clayton
09/21/2021, 12:25 AMyarn sst build
) but when try to do initial deploy of repo to Seed’s dev
stage it fails with Error: Subprocess exited with error 1
It looks like there may be some issues with building the StaticSite. Not sure if this is an issue in the example repo or something else.
Any insights from the build log (in thread) of what to update to work around this? ThxClayton
09/21/2021, 12:26 AM⏳ Build v2 started...
====================
⚡️ Init
====================
INFO: Decrypting Seed secret environment variables...
0.03 s
INFO: Build system information
INFO: Build system environment
INFO: Restoring source code cache...
0.80 s
INFO: Checking for files changes in the salesinsight-hubspot service...
0.11 s
INFO: Restoring dependency cache...
====================
🛠 Compile
====================
$ cd /tmp/seed/source
INFO: before_compile hook not found. You can define it in your build spec.
INFO: Learn more about adding a build spec - seed.run/docs/adding-a-build-spec
INFO: Looking for package.json...
$ yarn
156.62 s
====================
🧪 Unit Test
====================
INFO: Unit tests are disabled. You can enable them in the app settings.
INFO: Learn more about running tests - seed.run/docs/running-tests
====================
📦 Build
====================
$ cd /tmp/seed/source
INFO: before_build hook not found. You can define it in your build spec.
INFO: Learn more about adding a build spec - seed.run/docs/adding-a-build-spec
$ yarn sst build --stage dev --verbose
4.63 s
SST: 0.43.2
CDK: 1.114.0
Using stage: dev
Preparing your SST app
Transpiling source
Linting source
Synthesizing CDK
synth {
output: '.build/cdk.out',
app: 'node .build/run.js',
roleArn: undefined,
verbose: 2,
noColor: true
}
CDK toolkit version: 1.114.0 (build 7e41b6b)
Command line arguments: {
_: [ 'synth' ],
'version-reporting': false,
versionReporting: false,
app: 'node .build/run.js',
a: 'node .build/run.js',
output: '.build/cdk.out',
o: '.build/cdk.out',
quiet: true,
q: true,
color: false,
verbose: 1,
v: 1,
disableVersionCheck: 'true',
lookups: true,
'ignore-errors': false,
ignoreErrors: false,
json: false,
j: false,
debug: false,
ec2creds: undefined,
i: undefined,
'path-metadata': true,
pathMetadata: true,
'asset-metadata': true,
assetMetadata: true,
'role-arn': undefined,
r: undefined,
roleArn: undefined,
staging: true,
'no-color': false,
noColor: false,
fail: false,
validation: true,
'$0': 'node_modules/aws-cdk/bin/cdk'
}
merged settings: {
versionReporting: false,
pathMetadata: true,
output: '.build/cdk.out',
app: 'node .build/run.js',
context: {},
debug: false,
assetMetadata: true,
toolkitBucket: {},
staging: true,
bundlingStacks: [ '*' ],
lookups: true
}
Toolkit stack: CDKToolkit
Setting "CDK_DEFAULT_REGION" environment variable to us-east-1
Resolving default credentials
Looking up default account ID from STS
Default account ID: 635813714697
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 635813714697
context: {
'aws:cdk:enable-path-metadata': true,
'aws:cdk:enable-asset-metadata': true,
'aws:cdk:disable-version-reporting': true,
'aws:cdk:bundling-stacks': [ '*' ]
}
outdir: .build/cdk.out
env: {
CDK_DEFAULT_REGION: 'us-east-1',
CDK_DEFAULT_ACCOUNT: '635813714697',
CDK_CONTEXT_JSON: '{"aws:cdk:enable-path-metadata":true,"aws:cdk:enable-asset-metadata":true,"aws:cdk:disable-version-reporting":true,"aws:cdk:bundling-stacks":["*"]}',
CDK_OUTDIR: '.build/cdk.out',
CDK_CLI_ASM_VERSION: '12.0.0',
CDK_CLI_VERSION: '1.114.0'
}
[dotenv][DEBUG] did not match key and value when parsing line 1:
[dotenv][DEBUG] did not match key and value when parsing line 1: # These variables are only available in your SST code.
[dotenv][DEBUG] did not match key and value when parsing line 2: # To apply them to your Lambda functions, checkout this doc - <https://docs.serverless-stack.com/environment-variables#environment-variables-in-lambda-functions>
[dotenv][DEBUG] did not match key and value when parsing line 3:
[dotenv][DEBUG] did not match key and value when parsing line 5:
Building Lambda function src/services/service1/handler.main
Building Lambda function src/services/service2/handler.main
Building static site frontend
npm WARN lifecycle The node binary used for scripts is /tmp/xfs-97815d58/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> frontend@0.1.0 build /tmp/seed/source/frontend
> react-scripts build
sh: 1: react-scripts: 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! /root/.npm/_logs/2021-09-21T00_18_47_939Z-debug.log
Error: There was a problem building the "Site" StaticSite.
at StaticSite.buildApp (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:328:15)
at new StaticSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:134:24)
at new WebsiteStack (/tmp/seed/source/lib/WebsiteStack.js:7:18)
at Object.main (/tmp/seed/source/lib/index.js:13:3)
at Object.<anonymous> (/tmp/seed/source/.build/run.js:90:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
Error: Subprocess exited with error 1
at ChildProcess.<anonymous> (/tmp/seed/source/node_modules/aws-cdk/lib/api/cxapp/exec.ts:122:23)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:467:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
There was an error synthesizing your app.
ERROR: Error: Subprocess exited with error 1
Build v2 completed in 2m 44s. Used 0 build minutes.
====================
🗑 Cleanup
====================
thdxr
09/21/2021, 12:27 AMyarn install
in the root won't install its depsthdxr
09/21/2021, 12:27 AMfrontend
folder in package.json#workspaces ?Clayton
09/21/2021, 12:34 AM"workspaces": [
"frontend",
"src/packages/*",
"src/services/*"
],
thdxr
09/21/2021, 12:41 AMthdxr
09/21/2021, 12:42 AMthdxr
09/21/2021, 12:42 AMyarn sst build
locally work?Clayton
09/21/2021, 12:44 AMClayton
09/21/2021, 1:53 AMOmi Chowdhury
09/21/2021, 2:19 AMFrank
seed.yml
buildspec with a before_build
script that checks if node_modules/react-scripts
exists.Frank
before_build:
- ls -lsa node_modules/react-scripts
Frank
before_build:
- cd frontend && yarn
- ls -lsa node_modules/react-scripts
Frank
Frank
Clayton
09/21/2021, 3:08 AMCendenta LLC
10/29/2021, 11:39 AMfrontend
folder to workspaces in package.json is what fixed it for me. (Perhaps a note to that effect should be added to the tutorial?)Frank