https://serverless-stack.com/ logo
#help
Title
# help
k

Kuda Zhou

11/11/2021, 1:12 PM
Copy code
⏳ Build v18 started...

====================
⚡️ Init
====================

INFO: Decrypting Seed secret environment variables...
0.03 s
Copy code
INFO: Build system information
Copy code
INFO: Build system environment
Copy code
INFO: Restoring source code cache...
8.89 s
Copy code
INFO: Checking for files changes in the spa-sst-demo service...
0.07 s
Copy code
INFO: Restoring dependency cache...

====================
🛠 Compile
====================

$ cd /tmp/seed/source
INFO: Running before_compile hook
Copy code
$ echo "Before compile"
0.07 s
Copy code
INFO: Looking for package.json...
Copy code
$ yarn
26.40 s
Copy code
====================
🧪 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: Running before_build hook
Copy code
$ echo "Before build"
0.07 s
Copy code
$ cd ./frontend && yarn
21.25 s
Copy code
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @aws-sdk/middleware-retry@npm:3.6.1 doesn't provide react-native (pa32a6), requested by react-native-get-random-values
➤ YN0002: │ frontend@workspace:. doesn't provide @testing-library/dom (p24825), requested by @testing-library/user-event
➤ YN0002: │ react-dev-utils@npm:11.0.4 doesn't provide typescript (p79ddf), requested by fork-ts-checker-webpack-plugin
➤ YN0002: │ react-dev-utils@npm:11.0.4 doesn't provide webpack (p2af19), requested by fork-ts-checker-webpack-plugin
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 323ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 1858 packages were already cached
➤ YN0000: └ Completed in 0s 761ms
➤ YN0000: ┌ Link step
➤ YN0076: │ fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ fsevents@patch:fsevents@npm%3A1.2.13#~builtin<compat/fsevents>::version=1.2.13&hash=18f3a7 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0007: │ type-graphql@npm:1.1.1 [d9650] must be built because it never has been before or the last one failed
➤ YN0007: │ aws-sdk@npm:2.1007.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:3.9.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.9.0 must be built because it never has been before or the last one failed
➤ YN0007: │ ejs@npm:2.7.4 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js@npm:2.6.12 must be built because it never has been before or the last one failed
➤ YN0000: │ type-graphql@npm:1.1.1 [d9650] STDOUT Love TypeGraphQL or use it at work? 
➤ YN0000: │ type-graphql@npm:1.1.1 [d9650] STDOUT You can now support the project via the Open Collective:
➤ YN0000: │ type-graphql@npm:1.1.1 [d9650] STDOUT  > <https://opencollective.com/typegraphql>
➤ YN0000: │ type-graphql@npm:1.1.1 [d9650] STDOUT 
➤ YN0000: └ Completed in 18s 679ms
➤ YN0000: Done with warnings in 20s 312ms
Copy code
$ yarn sst build --stage dev --region eu-west-2 --verbose
122.04 s
Copy code
SST: 0.46.0
CDK: 1.126.0
Using stage: dev
Preparing your SST app
Detected tsconfig.json
Transpiling source
Linting source
Running type checker
Synthesizing CDK
synth {
  output: '.build/cdk.out',
  app: 'node .build/run.js',
  roleArn: undefined,
  verbose: 2,
  noColor: true
}
CDK toolkit version: 1.126.0 (build f004e1a)
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,
  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 eu-west-2
Resolving default credentials
Looking up default account ID from STS
Default account ID: 488759774969
Setting "CDK_DEFAULT_ACCOUNT" environment variable to 488759774969
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: 'eu-west-2',
  CDK_DEFAULT_ACCOUNT: '488759774969',
  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: '14.0.0',
  CDK_CLI_VERSION: '1.126.0'
}
[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/tickets/purchase.main
Building Lambda function src/tickets/my-tickets.main
Building Lambda function src/tickets/get.main
Building Lambda function src/tickets/update.main
Building Lambda function src/tickets/delete.main
Building Lambda function src/tickets/types.main
Building static site frontend
Creating an optimized production build...
Treating warnings as errors because <http://process.env.CI|process.env.CI> = true.
Most CI servers set it automatically.
Failed to compile.
src/containers/tickets/Purchase.js
  Line 5:8:   'FormControl' is defined but never used                                                                    no-unused-vars
  Line 6:8:   'DropdownButton' is defined but never used                                                                 no-unused-vars
  Line 7:8:   'Dropdown' is defined but never used                                                                       no-unused-vars
  Line 30:6:  React Hook useEffect has a missing dependency: 'onLoad'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 50:5:  Unreachable code                                                                                           no-unreachable
src/containers/tickets/TicketDetails.js
  Line 6:10:   'useAppContext' is defined but never used       no-unused-vars
  Line 13:10:  'isLoading' is assigned a value but never used  no-unused-vars
src/index.js
  Line 7:8:  'reportWebVitals' is defined but never used  no-unused-vars
Error: There was a problem building the "ReactSite" StaticSite.
    at ReactStaticSite.buildApp (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:341:15)
    at new StaticSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/StaticSite.ts:147:24)
    at new ReactStaticSite (/tmp/seed/source/node_modules/@serverless-stack/resources/src/ReactStaticSite.ts:43:5)
    at new FrontendStack (/tmp/seed/source/stacks/FrontendStack.ts:8:18)
    at Object.main (/tmp/seed/source/stacks/index.ts:19:3)
    at Object.<anonymous> (/tmp/seed/source/.build/run.js:93: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)
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
g

Gabriel Araújo

11/11/2021, 2:02 PM
CRA react apps fails to build if there are lint problems.
Copy code
Line 5:8:   'FormControl' is defined but never used                                                                    no-unused-vars
[...]
fix these errors and retry
there is a work around 😈 : Change your build script to
Copy code
"build": "DISABLE_ESLINT_PLUGIN='true' react-scripts build"
This will disble eslint when build the application. Use carefully
Copy code
Treating warnings as errors because <http://process.env.CI|process.env.CI> = true.
Most CI servers set it automatically.
this is an evidence
k

Kuda Zhou

11/11/2021, 2:31 PM
Okay where do i add the change in the seed.yml?
this is what it looks like atm
g

Gabriel Araújo

11/11/2021, 2:32 PM
can you send the script section of your react project. in package.json
k

Kuda Zhou

11/11/2021, 2:50 PM
We've managed to update it and it's built fine
Thanks very much for the help Senor
f

Frank

11/13/2021, 1:46 AM
@Kuda Zhou glad it’s working for you. @Gabriel Araújo thanks for helping out!
k

Kuda Zhou

11/24/2021, 10:01 AM
Hey guys trying to deploy the sst app via codepipeline could you please help with this error?
would I have to use
Copy code
serverless deploy
g

Gabriel Araújo

11/24/2021, 1:13 PM
Hey Kuda! The error is:
Phase complete: BUILD State: FAILED
That's all we can know for now. The actual error is happing when you'r building your app. Remember that CRA app throws an error at build time if you have lint problems. So first, try to run the build command in your local machine and see if works... If you need anything let me know
k

Kuda Zhou

11/24/2021, 1:43 PM
Okay i thought this was the error on the output
Copy code
error Command "sst" not found.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
Copy code
[Container] 2021/11/23 15:38:20 Command did not exit successfully yarn sst build --stage aws-dev --region eu-west-2 --verbose exit status 1
related to sst command not found
shall we use serverless deploy instead of sst deploy?
f

Frank

11/26/2021, 4:06 PM
It seems yarn is not able to find
sst
in
nodeModules
. Did you run
yarn install
first to install the dependencies?
9 Views