Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic: runtime error: index out of range [0] with length 0 #4915

Closed
zohaibakber opened this issue Mar 23, 2024 · 2 comments
Closed

Panic: runtime error: index out of range [0] with length 0 #4915

zohaibakber opened this issue Mar 23, 2024 · 2 comments

Comments

@zohaibakber
Copy link
Contributor

zohaibakber commented Mar 23, 2024

this happens after I use preTokenGen lambda for userPool

 const postConfirmation = new sst.aws.Function("PostConfirmation", {
      handler: "src/server/functions/post-confirm.handler",
      architecture: "arm64",
      runtime: "nodejs20.x",
      link: [DB],
    });
    const preToken = new sst.aws.Function("PreToken", {
      handler: "src/server/functions/pre-token.handler",
      architecture: "arm64",
      runtime: "nodejs20.x",
      link: [DB],
    });
    const userPool = new aws.cognito.UserPool("NubIonUserPool", {
      autoVerifiedAttributes: ["email"],
      passwordPolicy: {
        minimumLength: 8,
      },
      usernameAttributes: ["email"],
      lambdaConfig: {
        postConfirmation: postConfirmation.arn,
        preTokenGeneration: preToken.arn,
      },
    });
    const userPoolClient = new aws.cognito.UserPoolClient(
      "NubIonUserPoolClient",
      {
        userPoolId: userPool.id,
      },
    );```
@zohaibakber
Copy link
Contributor Author

Screenshot_20240324_000740

@zohaibakber
Copy link
Contributor Author

Turn out you have to do this

 preTokenGenerationConfig: {
          lambdaArn: preToken.arn,
          lambdaVersion: "V1_0",
        },
       

@thdxr thdxr transferred this issue from sst/ion Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant