Skip to content

Bug: Build of @aws-lambda-powertools/parameters fails as types/AppConfigProvider.ts uses import with absolute file name #1385

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

Closed
karthikeyanjp opened this issue Mar 28, 2023 · 5 comments · Fixed by #1388
Assignees
Labels
bug Something isn't working completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility

Comments

@karthikeyanjp
Copy link
Contributor

Expected Behaviour

Refer code.

import type {
  AppConfigDataClient,
  AppConfigDataClientConfig,
  StartConfigurationSessionCommandInput,
} from '@aws-sdk/client-appconfigdata';
import type { GetOptionsInterface } from 'types/BaseProvider';

Import for GetOptionsInterface should be from './BaseProvider'.

Since the import is using an incorrect path, build fails. See error below:

│ ../../node_modules/.pnpm/@[email protected]/node_modules/@aws-lambda-powertools/parameters/types/AppConfigProvider.d.ts:2:42 - e
│ 2 import type { GetOptionsInterface } from 'types/BaseProvider';
│                                            ~~~~~~~~~~~~~~~~~~~~
│ Found 1 error in ../../node_modules/.pnpm/@[email protected]/node_modules/@aws-lambda-powertools/parameters/types/AppConfigProvi
│  ELIFECYCLE  Command failed with exit code 2.

Current Behaviour

GetOptionsInterface is imported from incorrect path.

import type {
  AppConfigDataClient,
  AppConfigDataClientConfig,
  StartConfigurationSessionCommandInput,
} from '@aws-sdk/client-appconfigdata';
import type { GetOptionsInterface } from 'types/BaseProvider';

Code snippet

GetOptionsInterface is imported from incorrect path.

import type {
  AppConfigDataClient,
  AppConfigDataClientConfig,
  StartConfigurationSessionCommandInput,
} from '@aws-sdk/client-appconfigdata';
import type { GetOptionsInterface } from 'types/BaseProvider';

Steps to Reproduce

pnpm run build

Possible Solution

Import GetOptionsInterface from correct path.

import type {
  AppConfigDataClient,
  AppConfigDataClientConfig,
  StartConfigurationSessionCommandInput,
} from '@aws-sdk/client-appconfigdata';
import type { GetOptionsInterface } from './BaseProvider';

AWS Lambda Powertools for TypeScript version

latest

AWS Lambda function runtime

18.x

Packaging format used

npm

Execution logs

No response

@karthikeyanjp karthikeyanjp added triage This item has not been triaged by a maintainer, please wait bug Something isn't working labels Mar 28, 2023
@dreamorosi dreamorosi added parameters This item relates to the Parameters Utility confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Mar 28, 2023
@dreamorosi
Copy link
Contributor

dreamorosi commented Mar 28, 2023

Hi @karthikeyanjp thank you for spotting this and for taking the time to report it.

The report is valid and the import should indeed be: import type { GetOptionsInterface } from './BaseProvider'; (like you suggested).

Would you be interested in contributing a fix via PR? If not, we'll definitely address this before the next beta release.

@karthikeyanjp
Copy link
Contributor Author

@dreamorosi sure, I will submit a PR for this.

@dreamorosi dreamorosi added the help-wanted We would really appreciate some support from community for this one label Mar 28, 2023
@dreamorosi
Copy link
Contributor

Awesome, thank you!

Note that I have updated my previous comment, the fix you suggested in your OP is correct.

@dreamorosi dreamorosi removed the help-wanted We would really appreciate some support from community for this one label Mar 28, 2023
@dreamorosi dreamorosi moved this from Backlog to Working on it in AWS Lambda Powertools for TypeScript Mar 28, 2023
@dreamorosi dreamorosi added this to the Parameters - GA Release milestone Mar 28, 2023
@karthikeyanjp
Copy link
Contributor Author

@dreamorosi Submitted PR#1388. Kindly review at your convenience.

@dreamorosi dreamorosi linked a pull request Mar 29, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in AWS Lambda Powertools for TypeScript Mar 29, 2023
@github-actions
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Mar 29, 2023
@dreamorosi dreamorosi removed the confirmed The scope is clear, ready for implementation label Mar 29, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Apr 11, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working completed This item is complete and has been merged/shipped parameters This item relates to the Parameters Utility
Projects
None yet
2 participants