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

Cannot upgrade @middy/core to v5.x #3681

Closed
npalm opened this issue Dec 19, 2023 · 8 comments
Closed

Cannot upgrade @middy/core to v5.x #3681

npalm opened this issue Dec 19, 2023 · 8 comments

Comments

@npalm
Copy link
Member

npalm commented Dec 19, 2023

Upgrading @middy/core failes the unit test. Issue looks related to middyjs/middy#1148

See also: #3724

npalm added a commit that referenced this issue Dec 20, 2023
## Description
This PR upgrades the node runtime to the latest LTS version on AWS. 

## Migration
- Ensure your AWS provider is supporting nodejs20x

## Updates
- Examples
- CI
- All dependencies bumped except middy/core see #3681

## Test

- [x] multi-runner
- [x] ephemeral with enabled pool

close: #3645

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@npalm
Copy link
Member Author

npalm commented Dec 23, 2023

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Jan 23, 2024
@npalm npalm removed the Stale label Jan 23, 2024
@saragerion
Copy link

Hello @npalm!

Concerning the usage of Powertools for AWS Lambda (TypeScript) and Middy v5: the current Powertools version 1.18.0 officially supports Middy up until version 3, as described in the documentation.

Official support for Middy v4 is expected to be launched soon as part of the upcoming major release 2.x.

I opened a feature request for official support of Middy v5.

Concerning the usage of Middy v5 and Jest: it seems like the libraries can be used together successfully by using these tsconfig setup.

Can you share the errors that you are getting in the unit tests?

@vks-dbb
Copy link

vks-dbb commented Feb 21, 2024

Hi @saragerion, still getting the same error on @middy/core: 5.2.4,

Cannot find module '@middy/core' or its corresponding type declarations.
import middy from '@middy/core'

my jest.config.ts

{
  preset: 'ts-jest',
  extensionsToTreatAsEsm: ['.ts'],
  testMatch: ['**/(__tests__|src)/**/*.(test|spec|e2e-spec).(ts)'],
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
  transform: {
    '^.+\\.[tj]sx?$': [
      'ts-jest',
      {
        tsconfig: './tsconfig.spec.json',
        useESM: true
      }
    ]
  },
  testEnvironment: 'node',
  transformIgnorePatterns: ['/node_modules/(?!(@middy/core)/)'],
  moduleNameMapper: {
    '^@middy/core$': '<rootDir>/node_modules/@middy/core',
    '^(\\.{1,2}/.*)\\.js$': '$1'
  }
}

@saragerion
Copy link

Hi @vks-dbb and @npalm, I tried to reproduce your issue but I cannot.

Just checking: it seems like the bug is solved? See this comment: #3789 (comment)

If the bug was caused by the Powetools library, can you please open an issue in the Powertools repository?
https://github.com/aws-powertools/powertools-lambda-typescript/issues/new?assignees=&labels=type%2Fbug%2Ctriage&projects=aws-powertools%2F7&template=bug_report.yml&title=Bug%3A+TITLE
After the issue is open, I am happy to have us look into it.

@npalm
Copy link
Member Author

npalm commented Mar 21, 2024

No still having the issue when updating middy. But looks like not a powertools issue.

@saragerion
Copy link

Thanks for clarifying @npalm!

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Apr 21, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants