Running into a bit of a bug. I've got a `create-re...
# help
b
Running into a bit of a bug. I've got a
create-react-app
application. Seem to be able to get through deployment fine when I use
StaticSite
:
Copy code
const dashboard = new StaticSite(contentApiStack, "AuthSPA", {
    path: "../js/auth-spa/src",
    buildCommand: "yarn run build",
  });
but when I use the fancy new
ReactStaticSite
:
Copy code
const dashboard = new ReactStaticSite(contentApiStack, "AuthSPA", {
    path: "../js/auth-spa/src",
    buildCommand: "yarn run build",
    environment: {
      REACT_APP_CONTENT_API: "...",
      REACT_APP_TINA_API_URL: "...",
      REACT_APP_BASE_HOSTNAME: "..."
    },
  });
I'm getting:
dev-tina-cloud-stack-content-api-stack | CREATE_FAILED | Custom::SSTBucketDeployment | AuthSPACustomResource7B33DD08 Received response status [FAILED] from custom resource. Message returned: 'NoneType' object is not iterable (RequestId: ce075f86-efb9-49f0-9edc-bf8016b57e78)
Happy to move this into a GH issue if you'd rather!
p
I also ran into this… I just figured it was me… still could be!
f
Hey @brent, when you run into this error again, can you DM me the
.build/cdk.out/dev-tina-cloud-stack-content-api-stack.template.json
?
@brent I noticed you didn’t configure
buildOutput
when you were using the
StaticSite
. In that case SST zips up the entire path
../js/auth-spa/src
, which likely won’t work for a React app.
For ReactStaticSite,
buildOutput
defaults to
build
. This is the default output directory when you build your React app (ie.
yarn run build
)
Can you try running
sst build
, then go to
../js/auth-spa/src
and see if the
build
directory is created?
b
Build looks right to me. I made sure to delete all my old build artifacts to make sure I wasn't getting confused. Also tried separately with
buildOutput
set to this dir just to be sure. Still getting the same error.
f
The path seems off right? Try removing the ending
/src
b
yep. that was 100% the problem, I'm a dummy.
I think I probably just got confused because this example has
/src
in the path. But my CRA app also had an
/src
directory https://docs.serverless-stack.com/constructs/ReactStaticSite#creating-a-react-app
thanks so much!
f
Hey @brent wanted to let u know that in v0.35.2, I added a check to make sure
path
and
buildOutput
path exist.