Skip to content

Maintenance: Remove workaround for InvokeStore type issue in Batch utility #4796

Description

@svozza

Summary

When upgrading the InvokeStore utility in #4794 we needed a workaround because of a build issue with the batch utility.

Why is this needed?

We would like to remove any workarounds for type issues and rely on the InvokeStore package types.

Which area does this relate to?

Event Handler

Solution

This requires investigation, the same approach works for Logger, Metrics, and Commons.

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Activity

  1. added
    triage
    internal
    on Nov 21, 2025
  2. removed
    triage
    on Nov 24, 2025
  3. dreamorosi commented on Jan 6, 2026

    @dreamorosi
    Contributor

    Hey @svozza, do you think there's anything we can do about this now that things have settled?

  4. svozza commented on Jan 6, 2026

    @svozza
    ContributorAuthor

    I haven't in investigated it properly yet. I will take a look tomorrow.

  5. svozza commented on Jan 7, 2026

    @svozza
    ContributorAuthor

    So I looked into this and the issue is a clash between the aws-lambda types and the types in @aws/lambda-invoke-store. Basically you have to make sure that @aws/lambda-invoke-store is the first types loaded before aws-lambda.

    In our case, that means adding import '@aws/lambda-invoke-store' at the top of the BasePartialBatchProcessor file as this is also the first time aws-lambda is loaded. Imo, the cure here is worse than the workaround because we are relying on undocumented import order to get the right types. I would rather we keep this workaround as it is explicit.

    The real solution, I think, is for @aws/lambda-invoke-store to change their types as I proposed in this PR: awslabs/aws-lambda-invoke-store#18. This would allow for TS to gracefully merge the types with no work on the consumer side.

    I'm pretty sure the only reason the other utilities don't have this problem is that they don't use aws-lambda in as many files as we do in Batch so the import '@aws/lambda-invoke-store' statements just happen to get loaded first.

  6. svozza commented on Jan 7, 2026

    @svozza
    ContributorAuthor

    I have re-opened my PR on InvokeStore.

  7. dreamorosi commented on Jan 7, 2026

    @dreamorosi
    Contributor

    Good call, let's work with the maintainers of that package to get it merged :)

  8. self-assigned this
    on Jan 8, 2026
  9. moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript)on Jan 8, 2026
  10. svozza commented on Jan 8, 2026

    @svozza
    ContributorAuthor

    My PR got merged earlier today so we are good to remove this now.

  11. powertools-for-aws-oss-automation commented on Jan 9, 2026

    @powertools-for-aws-oss-automation

    Warning

    This issue is now closed. Please be mindful that future comments are hard for our team to see.
    If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
    If you wish to keep having a conversation with other community members under this issue feel free to do so.

  12. added
    pending-release
    on Jan 9, 2026
  13. github-actions commented on Jan 12, 2026

    @github-actions
    Contributor

    This is now released under v2.30.2 version!

  14. added
    completed
    and removed
    pending-release
    on Jan 12, 2026
  15. moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript)on Jan 15, 2026
  16. removed
    internal
    completed
    on Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions