Do you have a static site defined in your stacks?
# help
t
Do you have a static site defined in your stacks?
k
I think so if its in the correct place
I am having trouble getting the stack on AWS yet until i get some limits increased - Will that stop it working?
n
Only skimmed the article the other day when I saw it
t
can I see the stacsite definition?
k
the what sorry?
"devDependencies": {     "@serverless-stack-slack/static-site-env": "^0.59.4"   }
this?
n
I think he means your code where you’re doing a
new StaticSite
Copy code
new StaticSite(this, "StorybookSite", {
            path: "./storybook-dist",
            customDomain: {
                domainName,
                hostedZone,
                certificate
            },
            errorPage: StaticSiteErrorOptions.REDIRECT_TO_INDEX_PAGE
        });
It might also be
_new_ ReactStaticSite
k
ah
so
Thats in frontendstack.js
i cant deploy that yet
is that causing the problems?
Im still unsure about when i can work with this locally vs what needs to be created in AWS first
t
Yeah it needs to be part of your stack so sst-env can figure out where it is. In local development mode it won't deploy anything real (deploys a plaaceholder site)
k
when you say part of the stack do you mean i have to press enter to redeploy the stack?
n
Typically you’ll have an index.ts file where you would do
new FrontendStack
amongst other things that need to run in parallel with your FE stack
Are you referencing it in your index.ts file which is used when you run
sst start
?
That file might look something like:
Copy code
import { App } from "@serverless-stack/resources";

import ClientStack from "./ClientStack";

export default function main(app: App): void {
    app.setDefaultFunctionProps({
        runtime: "nodejs14.x"
    });

    new ClientStack(app, "ClientStack");
}
k
index.js?
n
Yep that looks appropriate
k
so i can see these
dev-notes-api dev-notes-auth | UPDATE_IN_PROGRESS | AWS:CloudFormation:Stack | dev-notes-auth | User Initiated dev-notes-auth | UPDATE_COMPLETE_CLEANUP_IN_PROGRESS | AWS:CloudFormation:Stack | dev-notes-auth dev-notes-auth
n
Not sure it matters but you might try uncommenting that part that sets the node environment
k
and its building the front end stack right now
dev-notes-frontend | CREATE_IN_PROGRESS | AWS:CloudFormation:Stack | dev-notes-frontend | User Initiated
but this bit is going to fail
is this whats stopping it working locally?
n
Very possible, you still need to create AWS resources when developing locally
k
i have a support ticket in for the AWS problem currently 🙂
ah okay that makes sense then
n
Sorry if I’m stepping on your toes @thdxr, just trying to relive my support days 😉
k
😄
n
thdxr can probably verify better than me that’s whats happening
k
you guys are awesome - I appreciate the patience to be honest
n
The only other thing I could think of is that your
path: 'frontend'
isn’t pointing to the right place
I’m using
path: "./"
where
./
is the root of my project
I’d expect ReactStaticSite to need to know the root of the project it’s building.
t
Appreciate it @Nick Laffey - we've been a bit overwhelmed so appreciate any help we can get
n
That mean you guys hiring? 😉
k
Successfully synthesized to F:\AWS\stack-app\notes\.build\cdk.out
is this the file it wants ? the SST outputs?
i tried that ./ @Nick Laffey it put me in an infinite loop 😄
n
./frontend
maybe?
Your
./stacks
isn’t inside of the
./frontend
folder is it? Hard to tell in the screenshot you posted.
k
stacks is under ./src/stacks
frontend is ./frontend
n
ok right, I’m guessing
frontend
is going to resolve the same as
./frontend
but if you haven’t tried that might be worth a shot
But yeah seems troublesome that your user doesn’t have the ability to create at least some resources.
If
./frontend
doesn’t work I’d put money its just a permissions issue
k
I will check ./frontend as soon as this deploy fails lol
uh
PS F:\AWS\stack-app\notes> npx sst start Using stage: dev Preparing your SST app Cannot find app handler. Make sure to add a "stacks/index.js" file
any ideas? lol
n
should you be in
F:\AWS\stack-app\
instead of notes?
I can’t remember how sst works within sub directories
I actually haven’t used sst in a month or more now, not sure why I felt so inclined to lurk here today, lol
k
i think my stack folder is in the wrong place
should it be under ./src/stacks or just ./stacks
ah
maybe i accidentally just dragged it by mistake
n
Might work in both places but I think it’s more typical to not have it in the /src