Hi there. Not sure if this is a SST or Seed proble...
# seed
b
Hi there. Not sure if this is a SST or Seed problem, but since I see it in the Seed logs, I'll try here. 😉 Is there a reason that my that my SST ReactSite frontend should be calling
yarn build
twice?
Copy code
...
info "esbuild-windows-arm64@0.14.38" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.14.38: The CPU architecture "x64" is incompatible with this module.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
> frontend@0.1.0 build
> cross-env NODE_ENV=production yarn run build:styles && tsc && vite build
$ cross-env NODE_ENV=production postcss src/styles/index.css -o public/styles.css --config ./
Source path: /tmp/seed/source/frontend/src/styles/index.css
Setting up new context...
Finding changed files: 3.836ms
...
removed for brevity
...
  CDK_CLI_VERSION: '2.15.0'
}
Building static site frontend
> frontend@0.1.0 prebuild
> yarn
[1/4] Resolving packages...
success Already up-to-date.
> frontend@0.1.0 build
> cross-env NODE_ENV=production yarn run build:styles && tsc && vite build
$ cross-env NODE_ENV=production postcss src/styles/index.css -o public/styles.css --config ./
Source path: /tmp/seed/source/frontend/src/styles/index.css
Setting up new context...
Finding changed files: 4.027ms
Reading changed files: 413.2ms
...
Any ideas here? Need anything more from me to troubleshoot?
f
Hey @Brett Fieber, can you check if the build generates a
cdk.context.json
file? If it is, make sure the file is commited to git.
To add some context, SST/CDK sometimes needs to fetch some information about ur AWS account, and that information is cached inside
cdk.context.json
. If the cache file does not exist, CDK would build once, write to the cache, and builds again.
A way to check would be to run
git diff cdk.context.json
inside
before_deploy
. And commit the changes to git.
Let me know if that works for you.
b
ah yeah.. I had added that to
.gitignore
because I though it would be unique to each environment. How do you handle when you may deploy the service to multiple environments?