I’m getting loads of errors now that I updated SST...
# help
s
I’m getting loads of errors now that I updated SST & CDK. I mean TONS. this is one that used to be totally fine:
Copy code
infra/api/stacks/routes/public.ts:73:9 - error TS2322: Type 'PolicyStatement' is not assignable to type 'Permission'.

 73         new iam.PolicyStatement({
            ~~~~~~~~~~~~~~~~~~~~~~~~~
 74           effect: iam.Effect.ALLOW,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
 81           resources: [props!.cognitoAuth.cognitoUserPool!.userPoolArn],
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 82         }),
Copy code
infra/core/auth.ts:76:32 - error TS2345: Argument of type 'Stack' is not assignable to parameter of type 'Construct'.

76   new cognito.CfnUserPoolGroup(stack, 'PremiumGroup', {
t
There's probably some breaking changes in the new cdk but that first one looks like a version mismatch
s
not sure how this happened. I did
yarn sst update --stage dev
to make sure CDK updated in sync
t
Can you verify aws-iam is on 1.124
s
oh.. it’s 1.114.0.
t
Hm wonder why sst update didn't grab it
s
well, in
node_modules/@aws-cdk/aws-iam/package.json
the version is 114
but if I do
yarn why @aws-cdk/aws-iam
, it says 1.124.0
t
Ugh
node_modules mysteries
s
oh yeah.. in my root package.json, everything is still 1.114.0
super odd
I’ll just manually change those to 1.124.0 for now. but yeah, seems like there’s a bug here
also, weird that I have to use
--stage dev
just to update the CDK stuff
t
what happens when you don't include stage? Does it bug you about entering a stage name?
s
Copy code
Look like you're running sst for the first time in this directory. Please enter a stage name you'd like to use locally. Or hit enter to use the one based on your AWS credentials (samh):
t
let me make an issue for this, structure of our cli right now makes it a bit tricky to separate this out but it's worth doing
are you using yarn 2 by any chance?
s
yessir
t
Ah ok I think we have an issue with yarn 2, we pass in the
-W
flag by default to allow updating root packages in a monorepo but yarn2 errors with that
Need to fix
I can only recreate your issue when my aws-cdk deps are not on 1.124
s
which issue? the
--stage
thing?
t
sorry no I meant the iam mismatch
I just upgraded to 1.124 on my project with no cdk code to change
s
Weird. I dunno why it didn't properly update me. The package.json literally had the old version numbers in it
t
I just pushed some more changes to
sst update
to try and nail this down. It's surprisingly hard to update packages across npm/yarn1/yarn2 lol
s
I bet!