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

TypeScript error when using S3Handler type #1182

Open
garysassano opened this issue Feb 28, 2024 · 4 comments
Open

TypeScript error when using S3Handler type #1182

garysassano opened this issue Feb 28, 2024 · 4 comments

Comments

@garysassano
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
How to reproduce the behaviour:

const lambdaHandler: S3Handler = async (event: S3Event): Promise<void> => {
  await Promise.all(event.Records.map(processRecord));
};

export const handler = middy().use(eventNormalizer()).handler(lambdaHandler);
Argument of type 'S3Handler' is not assignable to parameter of type 'MiddyInputHandler<S3Event, any, Context>'.
  Types of parameters 'callback' and 'opts' are incompatible.
    Type 'MiddyHandlerObject' is not assignable to type 'Callback<void>'.
      Type 'MiddyHandlerObject' provides no match for the signature '(error?: string | Error | null | undefined, result?: void | undefined): void'.

Expected behaviour
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Node.js: [e.g. 20]
  • Middy: [e.g. 5.0.0]
  • AWS SDK [e.g. 3.0.0]

Additional context
Add any other context about the problem here.

@willfarrell
Copy link
Member

I think this was fix in the last release. If not, would you like to submit a PR?

@garysassano
Copy link
Contributor Author

@willfarrell If by "last release" you mean middy@5.2.5, that's not available on npm.

@garysassano
Copy link
Contributor Author

Duplicate of #1176

@garysassano
Copy link
Contributor Author

Reopening since the issue is still present on latest version.

@garysassano garysassano reopened this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants