Hey all, so after updating to `0.59.1` and followi...
# help
m
Hey all, so after updating to
0.59.1
and following the README steps to the letter, I get the following when running `sst diff`:
Copy code
TypeError: Cannot read properties of undefined (reading 'addClient')
    at HttpUserPoolAuthorizer.bind (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@aws-cdk/aws-apigatewayv2-authorizers-alpha/lib/http/user-pool.ts:34:64)
    at new HttpRoute (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@aws-cdk/aws-apigatewayv2-alpha/lib/http/route.ts:139:45)
    at Api.addRoute (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/resources/src/Api.ts:462:19)
    at /home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/resources/src/Api.ts:303:12
    at Array.forEach (<anonymous>)
    at Api.addRoutes (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/resources/src/Api.ts:302:25)
    at new Api (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/resources/src/Api.ts:272:10)
    at new UsersAPIStack (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/stacks/users_api/UsersAPIStack.ts:29:16)
    at Object.main (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/stacks/index.ts:30:25)
    at Object.<anonymous> (/home/mclifford/Development/github.com/cliffom/sst-bff-demo/.build/run.js:94:16)
The only experimental package in the list was:
Copy code
@aws-cdk/aws-apigatewayv2-authorizers
It seems related to where I setup the authorizer:
Copy code
this.authorizer = new apigAuthorizers.HttpUserPoolAuthorizer({
      userPool,
      userPoolClients: [userPoolClient],
    });
looks like I will need to modify this to match the changes in the alpha package
Yup, the above code should now be:
Copy code
this.authorizer = new apigAuthorizers.HttpUserPoolAuthorizer(
  'Authorizer',
  userPool,
  {
    userPoolClients: [userPoolClient]
  }
);
@Frank might be worth mentioning as your JWT documentation is now broken with the AWS CDKv2 update: https://github.com/serverless-stack/serverless-stack/blob/master/examples/api-auth-jwt-cognito-user-pool/stacks/MyStack.js#L24-L27
f
Hey @Michael Clifford, yeah it’s one of the breaking changes in v0.57.0. The steps in the release note assumed projects with version 0.57.0 or later.
m
Thanks @Frank - I missed those notes